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

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Couchbase development environment setup using docker.

Consistent CentOS Framework for running Laravel web apps

Top 10 Tips on Developing Your Problem Solving Skills and Levelling Up Your Coding!

Thinking about states

Using PHP Output Buffering In Templating

Using environments for data projects: A guide for Beginners

Post Processing not Showing in WebGL Builds?

Writing logs into Elastic with NLog ELK and .Net 5.0

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.

More from Medium

Spawn Manager Cleanup

2.5D Phase1 Framework: Moving Platforms

Mobile Applications In Unity: Rainy Day Insurance — Unity Teams and AWS Services Set Up

[ SDL2 — Part 2 ] Your first SDL2 application