Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: jasperPT on August 10, 2013, 05:30:44 PM

Title: Need help setting this counter display up [SOLVED]
Post by: jasperPT on August 10, 2013, 05:30:44 PM
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
Title: Re: Need help setting this counter display up
Post by: jasperPT on August 10, 2013, 07:04:59 PM
Never mind, I just figured out how to use arrays and got it working like a charm!!!