Hey guys, i’m doing this game that uses animations like parkour movements. So the landing animations after the jump are very important for the game’s plot.
Currently i’m having this issue for trigger the animation of landing/rolling after the player jump or fall, and, in fact i don’t know the best way/logic to do it.
My actual code (only an idea):
function update(){
// ...
if (!player.body.touching.down){ // while player's in the air
if (player.body.touching.down){ // when player hit the groud
player.setVelocityX(0)
player.anims.play('land') // play landing animation
}
}
Obviously doesn’t work…
So, can one of you guys help me with the code or logic or the best way to identify when the player hit the ground?