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.

  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! :)