DEVLOG 4 - NavMesh


DEVLOG - NavMesh

This week the games was adapted to involve an AI characters who tracks the player using NavMesh. This system predetermines paths/surfaces that the AI can traverse and on runtime only the destination must be set.  Firstly, a function was created to set the target destination to the clicked location. This was achieved through sending a raycast at the position of the mouse click and setting the target to position on the first hit gameobject. 




Intuitively, the AI can follow the player by setting the destination to update to the players location.  


Following this, an enemy spawner was added and health was given to the player creating a simple game loop. Enemies will deal a given amount of damage on impact destroying themselves in the process. Health packs were added periodically to offset this. 


If the player health reaches zero the game concludes, destroying the player and displaying game over message in debug. 


Leave a comment

Log in with itch.io to leave a comment.