- Home /
it is pretty simple question. i am not abe to figure it out how should i do.
i have a jumping up animation and landing animation. i want to jump at certain height and then fall using landing animation. what is the best way. please note i want my falling animation to play at soon as i have reached certain height.
Answer by kreaturian · Oct 13, 2018 at 02:41 AM
Assuming you are only doing GetKeyDown to jump, I would just have the whole jump in 1 animation and time it with the jump.
Although if you are doing hold to jump, then just do:
if (Input.GetKeyDown(KeyCode.Space)){
// Play going up anim
}
if(Input.GetKeyUp(KeyCode.Space)){
// Play going down anim
}
but the problem here is if my player is in air and i stopped pressing jump. "Falling down" animation plays in air before he reaches the ground.
i figured out and it was solved. but now the problem is if my player keeps holding the jump key it just keep playing the jump animation even if have reached the ground
is there anyway to stop the player from continuously hold jump button.