KIT 207 week 4 tutorial: Navigation in Unity


For week 3's tutorial I altered my terrain from the previous tutorial to add a NavMesh. A NavMesh sits on the surface of an object (such as a terrain) and allows Artificial Intelligence to navigate on and around it. I then made a simple capsule object and gave it the NavMesh AI.

After creating my NavMesh, I had to create a moving obstacle so that the AI would avoid it. Initially, my obstacle went from on place to another instantly, without moving smoothly. I changed it so that the movement is more gradual.

Moving Obstacle

Made by me in Unity.
It's a little bit faster on the GIF than when I tested it. I removed some frames to get the GIF small enough to upload it here.

I then added an enemy to the game (another capsule). I programmed it to spawn where I click, and chase after the capsule. I made the decision to colour-code the capsules: blue for the player and red for the enemies. The last part the tutorial suggests using my Blender model, but I decided to leave it for the self-study.

Enemies chasing capsule

Made by me in Unity.

Leave a comment

Log in with itch.io to leave a comment.