Need help with implementing a "secondary_idle" animation

This works!
Do I keep the:
or animated_sprite.animation == “jump”

from the first photo in order to have the jump animation play as well? (line 44)
Originally, my run animation was looped and the jump was not, but I disabled looping for the run animation and used the second photo.

So each time any animation plays, the idle animation count is reset to wait (3 times) before the secondary idle plays, if I understand.
Could you explain a bit more on how animated_sprite.frame helps with the difference between the AnimatedSprite and AnimationPlayer nodes?

AnimatedSprite has a method called .play(animName) - which will play animation or will unpause it if it’s already were playing animation
In our scenario - we want to play our idle animation each time when it finishes, but our method .play couldn’t play (cause it’s already playing). That’s why we decided to after finishing animation - repeat it from zero - like, we set it in 0 frame when it paused (after reaching the last frame animation will be paused), then we use our .play method to continue (unpause) our animation

If your jump animation shouldn’t have loop, than do nothing for it, however it needs to be looped - then just do it like from my first photo (44-47 lines)

Have I explained it clearly?

1 Like

Ah, I understand now. Without moving the frame count back to 0 with animated_sprite.frame, the first idle animation gets stuck on its last frame.

Yep, it works.
This is great. Thanks!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.