To use root motion for moving and steering a character with Nav Mesh Agent component, follow these steps:
- Import the character with the Idle, WalkLeft, WalkForward, and WalkRight animations and set it up the same way as in the Using root motion to steer a character recipe, but don't write the RootMotionSteering.cs script as we will create a new one.
- Add the Nav Mesh Agent component to the character. Make sure it also has the Capsule Collider component and the Rigidbody component with frozen rotation in every axis. Also make sure that the Animator component's Apply Root Motion option is set to true and Update Mode set to Animate Physics (the same way as in the Using root motion to steer a character recipe).
- Bake the NavMesh ...