Hi,
Im having a little trouble trying to set up a display for an energy system that I have.
It seems very simple but cant get it to work elegantly.
I have a system that generates energy over time to a max of 6 energy.
you can spend this energy to cast a spell.
what I want to do, is create an energy orb that represents each energy token currently stored.
I can create a simple system that adds a new energy token (say a cube) and places it next to the previous created cube. however when I try to go in the reverse direction (ie use energy) I am having trouble.
The way I currently do it is store the last created cube as a game object variable, so that I know its position. This means I can delete this cube if that energy is used, but im not sure how to continue deleting more cubes if more energy is used.
is there a simple way of picking up the next object in line that I could use, Im thinking there might be a solution that uses arrays but im not quite sure how that would work.
Cheers,
Jasper