How to do it...

Now, we will learn how to make the proper changes to the NavMesh settings before baking:

  1. Create the game world with different areas. In our case, we will have regular areas (walkable), doors, and swamps.
  2. Open the Navigation window: Menu | Window | Navigation.
  3. Go to the Areas tab.
  4. Create a Swamp area with cost 6.
  5. Create a Door area with cost 2.
  6. Select the objects that will behave like swamps.
  7. Go to the Navigation window, and select the Objects tab.
  8. Change the Navigation Area value to Swamp.
  9. Select the objects that will behave like doors.
  10. Go to the Navigation window, and select the Objects tab.
  11. Change the Navigation Area value ...

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.