O'Reilly logo

Unity 5.x Animation Cookbook by Maciej Szcześnik

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required