How it works...

The traditional approach to animation in games required all the movement animations to be done "in place." Characters were only moved with code (in Unity, with the transform.Translate() and transform.Rotate() methods, by changing the rigidbody.velocity vector, or by using the rigidbody.ApplyForce() method). Animations were merely visual effects and the game could work without a single animation being played. In the root motion approach, animations drive the movement of a character. The translation and rotation data is captured from the root node (a bone in the rig's hierarchy) and applied to the whole character in game. There are a few pros and cons to each approach:

Traditional approach Root motion approach
Pros

 

  • Small number of animations
  • You can prototype without a single animation
  • You can adjust the speed of the character easily
Pros

 

  • Looks more natural, there is no foot sliding
  • You can create complex moves and even game mechanics with animations
  • You can have irregular movements such as a wounded or zombie walk
Cons

 

  • Hard to remove foot sliding
  • Special attacks and evasion moves have to be programmed
  • Looks "last gen"
Cons

 

  • Requires a bigger number of animations
  • You can't move your character without an animation
  • Longer prototyping iterations

There are a few important options regarding root motion in the Animation Import Settings:

  • Root Transform Rotation: This option captures the rotation of the root node and applies it to the whole game object. You can set it to Bake Into Pose to disable the root motion rotation. With this option selected, the rotation will be treated as a visual effect of the animation and will not be applied to the game object. You should set it to true for every animation that shouldn't rotate the character. You can set the Based Upon option to one of the following options:
    • Original: This is the original root node rotation from the animation file.
    • Body Orientation: This alters the original rotation to make the character's upper body face the Z axis of the game object (the forward axis). You can also set the Offset option to offset the rotation.
  • Root Transform Position Y: This option captures the vertical movement of the root node and applies it to the whole game object. You can set it to Bake Into Pose to disable the root motion in the Y axis. With this option selected, the Y axis motion will be treated as a visual effect of the animation and will not be applied to the game object. You should set it to true for every "on ground" animation (unless it's a jump). You can set the Based Upon option to the following options:
    • Original: This is the original root node Y axis motion from the animation file.
    • Center Of Mass: This aligns the center of mass with the root node vertical position.
    • Feet: This keeps the feet aligned with the vertical root node position. You can also set the Offset option to offset the vertical root node position.
  • Root Transform Position XZ : This option captures the horizontal (XZ) movement of the root node and applies it to the whole game object. You can set it to Bake Into Pose to disable the root motion in the X and Z axis. With this option selected, horizontal motion will be treated as a visual effect of the animation and will not be applied to the game object. You should set it to true for all stationary animations (such as Idle). You can set the Based Upon option to the following options:
    • Original: This is the original root node horizontal motion from the animation file.
    • Center Of Mass: This aligns the center of mass with the root node horizontal position. You can also set the Offset option to offset the horizontal root node position.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.187.210