- Home /
How to make the character jump different distances relative to his running speed? (Root motion)
I have a character which walks/runs at different speeds, using Root Motion.
I have one jumping animation but I would like to adapt the jumping distance to the speed of the character just before the jump.
How do I adapt the jump distance to the running speed?
Answer by ninja_gear · May 20, 2016 at 02:06 PM
When you apply the movement of the jump...
Either get your Velocity from your CharacterController or your NavMeshAgent (if your not using these components to move then you have to otherwise manually save your last position and use that to find Velocity) and apply Vector to the movement of your 'Jump'.
OOOOORRRRRR.......
When you apply the movement of the jump, only apply movement that is relative to the 'up and down' of the scene, whilst making sure to check if you are on the ground (unless you want control in the air).
Hi there, thanks for your response. How do you only apply movement relative to up and down only? I'm using $$anonymous$$ecanim with root motion animation. Is it something I have to do in script? Thanks!
I am pretty sure the $$anonymous$$ecanim doesnt control world space movement, you prolly have a CharacterController Component attached to the GameObject, right? What is causing a button press to change the transform's position of the $$anonymous$$ecanim's GameObject at runtime? That will be the code that has to be rescripted to behave the whichway you wish.
Your answer

Follow this Question
Related Questions
How to blend from random idle spin to animation 2 Answers
How can I modify all fields of a Child Motion of a Blend Tree through Script? 1 Answer
Changing speed of specific animation state, at runtime 1 Answer
not sure what im am screwing up with mecanim 0 Answers
Player Sliding without any Input 2 Answers