Smart AI with NavMesh

What if your player goes through an object when you click the other side of that object? It shouldn’t be like that, right?

Since we added the NavMesh and made the player move in the last article. The player moves but it moves through objects. Now we will fix this by making these objects static.

Create Static objects

  1. Choose the objects which will be static
  2. Then you go to Inspector and click Static

3. After that, you go back to the Navigation Tab, click Clear, and then Bake again.

4. Now if you have your Gizmos on you should see grey areas around those objects you just made static.

5. And now your player can’t go through those objects! :)



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Janika Suhonen

Janika Suhonen

From the beautiful snowy country with a touch of "good" humor? Inspired Unity Developer to learn more.