- Home /
How to ground the player after jump animation completes
Hello developers, I hope someone will help me in finding a solution for my problem. I have a character who runs straight down a track with obstacles. it has Run, Jump, slide animations. I set the wrapmode for jump animation as clamp forever. In my jump script I used rigidbody.addrelativeforce method. The problem is when i triggered the jump function the character jumps with the animation crossfades from run to jump. But the Jump animation completes before the character lands which really looks bad. What I want is the jump animation should play till the player lands. Please help. I am new to scripting. Here is my code. public void jump(){ Rigidbody.AddRelativeForce(0, jumpForce, 0, ForceMode.VelocityChange); playerAnimation.jump(); } Thanks