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 off-mesh links, follow these steps:

  1. Import the character with Idle, WalkLeft, WalkForward, WalkRight, and JumpOffMesh animations.
  2. Create a new Animator Controller.
  3. Right-click on the empty space of the controller and choose Create State | New From Blend Tree. We need two such states. Name one of them Idle and the second one Steering.
  4. Create two float parameters in the controller, Speed and Direction, and one bool parameter, JumpOffMesh.
  5. Create two transitions:
    • Idle | Steering with one condition: Speed parameter value greater than 0.5. Has Exit Time should be set to false and Transition Duration set to around 0.2 seconds.
    • Steering | Idle with one condition: Speed parameter value less than 0.5. Has Exit ...

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