Animation Player Stuck

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

So I’m making a 2D top down RPG game and I started making the attack. I have a state machine and when I switch to the attack state the animation for the attack should be played. Instead of that, when it switches into the attack state it only plays the first frame and then gets stuck.

I know it will work if I use an AnimationTree but in this game the player doesn’t have animations for up and down he just goes to the side and switches the “flip_h”. So you cant make triangles in blendspace2D when you only go from one side to another.

my code:

func attack_state():
    anim_player.play("Attack")

Anybody got a solution? Have a nice day!

update: no need for anwsers i managed to fix it. it was because my other animations were overlaping each other and i just removed my whole animation function and put the walk animations in my walk state and switching to idle in physic process

xtuneon | 2022-01-09 19:49

:bust_in_silhouette: Reply From: umma

noob here but, did you put the animation player in loop?