Any idea on how to travel alternately between three animations?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Sugor

I wanted to play 3 different animation everytime I press this key.
I kinda don’t how to figure it out so i’m asking for help.
This is how it looks:
If Input “A” is pressed:
Play animation Run_A
Play animation Run_B

everytime i hit the key it play it alternately like Play Run A then Run B next or Play B then Run A next.

:bust_in_silhouette: Reply From: exuin

Just have a variable keep track of which animation was last played and then play the one that wasn’t.

I kinda get it, but how to do it though? I’m a beginner so I don’t quite familiar with how I will type it in actual code something like that is explained. thnka you!

Sugor | 2021-04-19 19:55

something like this?

var past_anim = "a"

if past_name == "a":"b")
    past_anim = "b"
    past_anim = "a"

exuin | 2021-04-19 21:39