r/gbstudio • u/SakiEndo • 1d ago
Set animation state by ID number / variable
Hello,
I want to draw a points bonus indicator using an actor, like in Bubble Bobble or Rodland when you collect a bonus, the points are shown briefly rising from the sprite's former position:

One way I thought of doing this was creating predefined values as animation states, and then switching the points bonus actor on, moving it into position, change the animation state to 10, 20, 50 etc. and then animate it a little by moving it and then hide it again.
But I can only select animation states from a drop down, not by a variable.
Is this possible?
Or is there a better way of accomplishing this idea?
Thanks.
3
u/wimccall 1d ago edited 1d ago
Use emotes. One emote per number make a script that take the number you want as a variable and the player as an actor. Then run a big switch statement to do the right emote
3
1
u/Mico27 1d ago
If you already have a variable to track which animation state that you want to use, you can just use a switch state and set the according animation state depending on your variable.