Root Motion
There are two types of animations:
- In Place
- Root Motion
An In Place animation either doesn't move the animated character at all or it resets its position once the animation is finished. A Root Motion animation on the other hand applies motion relative to the world space. A walking animation would thus continue moving the character even when the animation loop restarts.
The following tutorial made by Unity explains the difference:
Unity Tutorial Video Explaining Root Motion
Important: If you have problems with your exported root motion animations, take a look at the Exporting Animations FAQ.
Humanoid Root Motion
A Humanoid project in UMotion always has root motion enabled by default for the hip bones. It is not possible to select a different bone.
Generic Root Motion
For Generic animations Root Motion needs to be enabled manually. Legacy Generic animations don't support Root Motion.
At first the following steps should be done to prepare the animated model for Root Motion:
- Navigate to the model in Unity's Project window and select it. Make sure that the model is currently not used in the Pose Editor because otherwise selecting isn't possible. The inspector will now show the import settings for that model.
-
Open the Rig tab and select the bone/transform that should be used to drive Root Motion as Root node. Use the same bone/transform that was used to drive Root Motion in the 3D modeling application. If there are existing animations in separate files (this is a common practice), also select the same Root node there. If there is no Root Motion animation for the model yet, you can choose a bone/transform that fit's best for your purpose. It makes sense to either use the topmost bone (commonly named "Root", "Armature" or "Bip001") or to select none. In the latter case, the GameObject's root will be used.
Model Import Settings - Rig
-
If you have existing animations that are driven by Root Motion, switch to the "Animations" tab in the import settings of that animation (if it is in a separate file). Then scroll down to Motion and select the same bone/transform there.
Model Import Settings - Animations
- In the Clip Editor of UMotion, the same bone/transform that was previously selected in the model import settings needs to be set to drive root motion. Therefore the context menu of the appropriate animated property needs to be opened in the Animated Properties List (context click on the property or left click on the gear icon) and Root Motion needs to be clicked (see Animated Properties List). Root Motion can be activated for position properties and for rotation properties.
- Please note that Unity does not support Euler Rotation for generic root motion curves.
Using a Root Motion Animation
Once the animation is exported as *.anim file, it can be used together with a Unity Animator Controller. It's important that in the Animator Component of the GameObject that will use the animation Apply Root Motion is enabled.
Animator Component