How it works...

This recipe has a few key elements that make it work:

  • NavMesh and NavMesh Agent: Nav Mesh Agent component is used to navigate in the game level with a baked NavMesh. Without one of those elements, our character wouldn't be able to move effectively with point and click input.
  • Disabling the agent's updateRotation and updatePosition: By default, NavMesh Agents update the rotation and position of a game object. To use root motion, we need to disable this feature and update the game object's position and rotation with the root node animation instead.
  • Rigid Body and Animator with Apply Root Motion set to true: We use Rigid Body to have collisions between all the objects in the game (not only other NavMesh Agents) and we use the Apply Root Motion option in the Animator to make the character move with root node animation.
..................Content has been hidden....................

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