How to do it...

To use root motion for climbing, follow these steps:

  1. Import the character with Idle, WalkLeft, WalkForward, WalkRight, ToClimb, ClimbIdle, ClimbUp, and ClimbEnd animations.
  2. Create a new Animator Controller identical to the one from Using root motion to steer a character recipe (with Idle and Steering states).
  3. Add the Rigidbody component to the character and freeze its rotations.
  4. Add the Capsule Collider component to the character and make sure its Height and Center properties are set correctly (the Capsule Collider starts at your character's feet).
  5. Attach the RootMotionSteering.cs script to the character. It should now move (make sure to have a collider on the ground).
  6. Drag and drop the ToClimb, ClimbIdle, ClimbUp, and

Get Unity 5.x Animation Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.