How do I prevent root motion completely with a humanoid mecanim?

Hi guys, simple question (I guess)

How do I prevent my character from drifting? Even if I turn on “bake into pose” in every setting the XZ position still changes a little. Is it even possible to not move at all without scripting?

If you wan to completely shutdown the root motion, simple un-check Animator.ApplyRootMotion, but if you do this your avatar won’t move at all. If what you want is control proceduraly your root motion, you can override MonoBehaviour.OnAnimatorMove and set manually your root transform position and orientation.

2 Likes

Is it really moving, or is it just rotating. Something I’ve seen quite a few time, especially with looping animation, is the character slightly rotating. Most of the time, I usually lock the rotation too.

That basically answers all, I did uncheck ApplyRootMotion for now, but since I lose some features i might have to override the animatiormove callback. I just thought baking into pose in XZ would solve it but i guess not if the animation leans to much or is too fast