I have an instance variable for state on my player. When the player is moving state = run. When stopped state = idle, and so on. When in a certain state, a respective animation is set to play corresponding to the state.
When the space button is pressed, the state is set to attack. This seems to override all everything which is what I want. When the player is running and space is pressed, the run state/animation is overridden by the attack state/animation. However, it's not working that way for jump. Not sure what I'm doing wrong but have tried a few things and can't get it to change the jump animation to the attack animation. (it even works while the player is fallen)
Appreciate any help anyone is willing to provide.