I’m working on attack animations, but when you press the attack button it only plays the first frame of the animation and you can still move and everything. I copied the code from the tutorial (I think I did), but it just isn’t working. What did I do wrong?
Your issue is that
Nothing prevents what is in red rectangle from playing when what is in green rectangle plays
So when you do anything in green rectangle
Animations from both rectangles play and they fight for the right to be played
I got it to play the full animation, but you can still move while the animation is being played and if you hold down the button for the up attack it just stays at the first frame.
SOOOO Again you are not preventing animation from playing when it should not play
You cannot only allow animations to play when you want/need them
But also prevent them from playing when you don’t
FOR EXAMPLE
If you want to make diagonal movement animation
You will go for something like left is pressed and up is pressed
Well when you have left animation you also have left is pressed
So you are creating conflict
For diagonal left up it would be
Left is pressed
Up is pressed
For diagonal left down it would be
Left is pressed
Down is pressed
And for left it would be
Left is pressed
INVERTED Up is pressed
INVERTED Down is pressed
You need to start understand what will happen just by reading your own conditions
Or you will sit here each time you add new animation