Redirect Root Motion

The information on this page applies the same whether you're using Animancer or regular Animator Controllers and the scripts are included in Animancer Lite so feel free to just grab them if you aren't using Animancer.

It's usually a good idea to keep a character's logical components separate from their model for organizational purposes, so you might have a hierarchy like this:

In that case, the Animator will apply any Root Motion to itself by default, causing it to move away from the Collider and Rigidbody if they aren't on the same object.

Animancer includes several scripts which solve this problem by redirecting the Root Motion to a various different object types.

Default Root Motion Redirected Root Motion

To use these components, simply add one of them to the same object as the Animator and set its Target to the object you want to apply the Root Motion to. If a component of the Target type is on a parent object, it will be assigned automatically.

Component Redirects To
RedirectRootMotionToCharacterController CharacterController
RedirectRootMotionToRigidbody Rigidbody
RedirectRootMotionToTransform Transform

Those scripts are located in Assets/Plugins/Animancer/Utilities/Redirect Root Motion and have no external dependencies so feel free to just grab that folder if you want to use them without Animancer.