Skip to main content

Root Motion

Rukhanka Animation has full root motion support for humanoid and generic avatars and animations.

Follow these steps to enable root motion for your model:

  • Configure Root motion as usual from motion configuration section of animator importer window:

    Root Motion Config

  • Generic rigs only: Configure Root node field in model importer window to the bone that will be used to drive object movement.

    Root Motion Model

  • Enable the Apply Root Motion checkbox in the Unity Animator component:

    Root Motion GameObject

Custom root motion handling​

Sometimes root motion calculated movement needs to be propagated to other systems. There is the RootMotionVelocityComponent that can be used to obtain root motion velocity for the current frame. If you don't want to move the animated entity by Rukhanka Animation's root motion code, it can be disabled in RigDefinitionAuthoring. Root Motion Mode property controls Rukhanka Animation's root motion operation mode:

  • Normal. Standard operation mode. In this mode Rukhanka Animation will move entity according to root motion tracks if this is requested.
  • Disable Builtin Movement. Calculate root motion, but do not apply it to the entity position.

In both modes RootMotionVelocityComponent gets updated with current frame velocity values.

Read the component after RukhankaAnimationSystemGroup has updated. worldVelocity is the current frame's world-space linear velocity; deltaPos and deltaRot are the animation movement delta in the rig's movement space. Do not treat deltaPos as an already world-space displacement or multiply it by delta time a second time. When applying movement through a character controller, use Disable Builtin Movement to avoid moving the rig twice.

In User Defined rig mode, enable root motion on Rig Definition Authoring itself. CPU animation is required in either mode. See Root Motion sample for a configured rig.

Root Motion Mode