I am working on an animation for a platform fighting game, and having trouble with the attack animations.
For instance when the player presses the “S” key the character is supposed to do a “back kick”.
I’ve tried two different conditions on the input:
1 - Input.check(Key.S) this causes the back kick to be performed and held in the air as long as the key is held (if looping set to true), and if the key isn’t held long enough the animation wont complete.
2 - Input.pressed(Key.S) this causes the first sprite of the animation to flash quickly before returning back to the “standing” animation.
In part of the update loop I check all the states like speed, direction, onGround etc… and play animations accordingly. It seems like when I use the Input.pressed, the “back kick” animation is interrupted with the standing animation when update finds out that the character has no x-speed. Should I have interrupt the state-checks that play other animations for the duration of the “back kick”, or is there an option of method that give an animation priority to play?