The Wonder Of Navigation Meshes

 Hello again!


This week I'm here to talk to you about Navigation Meshes.  My story begins with the creation of our worshipers, little minions that are going to be the source of your power (and your tower's power).  I created these little guys so that they'll follow you around - only problem is that at first, they didn't.



The first time I spawned my little stone golem minion, I thought I could control it with a simple velocity call.  I was completely wrong!  It needs the MoveToLocation() function AND a navmesh.



I learned the hard way because our original navmesh looked kind of like this - 



and the worshipers still didn't move.  I had to dive deep into the workings of the navmesh and discovered another use for the NavMesh Modifier Volume.  Up until now, we were using them to limit the navmesh.  I discovered that you can use them to add weight to various sections of a navmesh in order to persuade the AI to take those paths instead!  Our new navmesh looks like this - 



with the pink being weighted with 1 and the blue being weighted with 100.  This way, the enemies follow the pink path but the worshipers, who are forced to follow you, have to trudge through the heavy blue when there's no other option.  Isn't it great having little minions that love you?


Thanks for tuning in and I hope to see you next time,

Corbin Mein

Comments

Popular posts from this blog

My boy is ALIVE!!!

Piecing Together The AOE Attack