- Home /
Vertical root motion and rigidbody / character controller
I have created a simple motion in Unity that moves 5 points up the Y axis over a second and then moves back to original spot and want to use it as a basic motion for jump prototyping.
This motion works fine on objects that don't have Rigidbody or Character Controller, but simply doesn't work on objects that have either. Though, if i add X and Z axis movements to the motion, they work just fine. I imagine this is something to do with gravity, but since this motion is created in Unity it has no animation import tab where i can change the gravity settings.
Any way to make it work?
EDIT: if the rigidbody is set to kinematic, the vertical root motion works. Kinematic rigidbody is way too far from what i need, though.
EDIT2: discovered a piece of downright weird behaviour. A character controller in itself has no gravity. However, once i add Animator and enable root motion, this in itself - even with animation having no root motion whatsoever - causes gravity to be applied. So apparently Animator has decided that it has something to do with gravity and there is no good way to control it.
Answer by osybear · Jan 08, 2018 at 04:50 PM
Reset the Animator Component and try these few things.
Enable Apply Root Motion
Update Mode Animate Physics.
Just tried it myself. It does work as it is changing the values but at a very $$anonymous$$uscule level.
Seeing as how you got a $$anonymous$$or change in values, i tried it again with a 100 point vertical motion, ins$$anonymous$$d of 5 points, and it worked. Seems like the motion needs to work against gravity. While i'm not a fan of using motion to work against gravity, this should suffice for my purposes for now. Thanks!
Your answer
Follow this Question
Related Questions
How to make root motion in cat .fbx drive movement? 1 Answer
Unity Root motion Offesets object on Y axis 0 Answers
How does the Animator drive Rigidbody with root motion (in detail)? 1 Answer
Aircraft Control 1 Answer
Move Character Controller 0 Answers