[Solved] Attack animation only plays the first frame - Gdevelop platformer

The problem is with the last 2 events. When you press ‘P’ and nothing else, the player will be on a floor/platform object and not moving. This satisfies the second to last event condition, and the animation is set to 0.

But in the next event the 'P' key pressed condition is true and so the animation is set to ‘Slash’. Because the animation has changed (from 0 to ‘Slash’), the Slash animation start afresh, giving the appearance of being stuck in the first frame.

To fix this, add a condition to the second to last event. Either check that the ‘P’ key is not pressed (invert the 'P' key is pressed condition), or check that the slash animation is not playing. Both ways should work.