#Polishing Question

3 messages · Page 1 of 1 (latest)

hallow jetty
#

So I am making a card game right now, the moment player clicks generate, player will generate resource from left to right of the cards. is there a way for me to you know, animate and make it generate one by one instead? is the only way to do it is to delay them and sleep them? WOuld love to hear other approaches

hallow jetty
#

bump

rustic spruce
#

Some combination of animations and/or Tweens could probably be used. If the card slots are effectively static (they won't move and cards will always only ever spawn there) then you could attach an animator to your cards. If you are storing the cards you put into your slots and their order, then from there you could drop logic into a _process() function in your assigned "card manager" or "game manager" class that has a reference to your ordered card list... and in order play the animation for it to go to its spot from somewhere. To get the "left to right" part working, you could just throw a code-driven timer or something into that process function and after every 0.25 seconds, play the animation for the next thing in that list.

If positions and stuff of your scene objects will be less predictable, you can also look at Tweens.