Week 4 - NavMesh


Worked with NavMeshes for the first time, which is a surface that AI use to navigate the game world. The exercise involved getting a model to move  where we clicked, and being able to jump over points in the world. I successfully got one of my older models animating within Unity, but decided to use the environment we were given rather than my own due to it not having slopes or gaps.

We had to write a script to get an object to move back and forth across the level, which I found difficult with my lack of experience scripting in Unity. Getting an object to move only took a few seconds, getting it to move back took a while. In the end I realised the problem with my script was that the transform coordinates weren't defaulting to where the object started, but was teleporting it offscreen. One by one I'm getting past these obvious things. I also ran into another problem where Unity was picking up past scripts that should have been deleted from the project (the solution being to go into the folder in Windows Explorer and delete them manually myself), but at least now I know about that issue and will be able to fix it quickly next time.

Here you can see the Mandragora moving where I click and interacting with the moving capsule (the little dude I'm controlling with ASWD).



The next task was to create enemies wherever I clicked that would chase the player. Unfortunately I ran into the error "Failed to create agent because it is not close enough to the NavMesh". The coordinates printing in the console are accurate to where I'm clicking, and I haven't been able to find any solutions online. I also believe I'm creating exponentially more agents every time I click, based on the Hierarchy window.



There were further tasks to have the enemy chase the player character and predict where the character would be going, and to get this working in my own scene. Unfortunately I can't afford to spend more time, this task ended up taking me longer than I've spent on multiple other units in the past week combined, and I still need to do the self study module.

Get UTAS KIT207 Portfolio

Leave a comment

Log in with itch.io to leave a comment.