0 votes

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!

Godot version 3.4.2
in Engine by (22 points)
reshown by

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

1 Answer

0 votes

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

by (293 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.