How to do it...

  1. Put the level in place.
  2. Create an empty game object and call it NavMesh.
  3. Add the NavMeshSurface component to the NavMesh object.
  4. Hit Bake.
  5. Select all the obstacles.
  6. Add the Nav Mesh Obstacle component to them.
  7. Check the Carve option in the component.
  8. Select the dynamic obstacles.
  9. Uncheck the Carve Only Stationary option.
  10. Configure each obstacle as needed, using the other options in the component.

Get Unity 2018 Artificial Intelligence Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.