O'Reilly logo

Unity Character Animation with Mecanim by Jamie Dean

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

Pathfinding and obstacle detection with navMesh

NavMesh is Unity's pathfinding system. It works by defining the navigable areas of the game level, storing this as a simple mesh. Once areas that can be accessed are defined, the navMesh is baked like a lightmap.

This system offers numerous advantages over waypoint systems. Firstly, it allows an AI character to roam freely within a level.

  1. Open the scene Chapter9_nav_Start.

    The scene contains the office environment with a navMesh already baked. The steps taken to set this up are well documented on the Unity website.

    We can view the generated navMesh by activating the Navigation panel.

  2. From the menu bar, choose Window | Navigation.

The Navmesh Display box will appear in the lower right of the Scene view. ...

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