Devlog 3.5: Meshy Meshes


The tutorial for this week included creating a NavMesh. Creating a NavMesh in Unity is like drawing a clear path for characters (called 'Agents') - you mark where they can walk and what they should avoid, and Unity uses this to create a navigation map. It's a bit like giving a character a GPS to move around smartly without bumping into obstacles - it's AI! Doing these steps directly in Unity's editor means that no expensive calculations are needed at runtime - this is called baking.

The applied NavMesh on the terrain, as provided by KIT207.

Unity is very smart and can automatically map out the navigable areas, including slopes and ledges. However, I was not able to apply the NavMesh obstacle for some reason, even after ticking all of the correct boxes and applying the bake. The instructions and interface differ greatly, depending on the Unity version; in the near future, I will take some time to investigate the issue.

The portfolio task involved creating an enemy AI summoned by a click, which would then follow the player using raycasting. One script instantiates a prefab of the enemy at the mouse position via raycasting, which I attached to the player (though this could be attached to anything in the scene). Another script sets the prefab as a NavMesh agent, detects the player within range and navigates towards them, while also continuously facing their direction (though I was unable to fix the model, so their 'front' is actually one of their arms).


The enemy is summoned and then gives chase (forgive the lack of frames).

Due to personal circumstances impacting my availability, I have been unable to work as efficiently and as deeply as I'd like to. In the coming weeks, I hope to catch up and apply these skills to my own creations. Thank you :)

Leave a comment

Log in with itch.io to leave a comment.