Animation for player falling

How can I play an animation if the player is falling (increasing Y position)?

you could make a function which checks if player.body.onFloor() returns true or false, and plays the animation if the player is not on the floor, however this would apply to jumping too… It’s not too clear from your question and lack of code snippets if you need jumping to have a separate animation.

You could also create a listener which checks for y acceleration and plays the animation if triggered. This would still apply to downwards motion in a jump.