First Time Nav Mesh
- Cameron Belcher
- Mar 28, 2019
- 2 min read
I've always felt the need to work with my own pathfinding methods, and because of this I never researched into third party methods. This semester I had the opportunity to learn more what other producers have produced and how to work with their work. One such work is the Navigation Mesh inside of Unity. It's a very simple method to work with. You just need to attach an agent component within the game object and bake a the navigation mesh and you're good to go. With our game, however, we found that our ingredients had no need for such a process. Instead we are using a whisker method. We have two whiskers, one point 45 degrees to the left of the local forward and one 45 degrees to the right of the local forward. When an ingredient approaches an ingredient, player, or wall it turns to the opposite whisker to avoid. Another way to make the ingredients feel better, and not stick to the side, was randomize the direction they would go. Every x amount of seconds they would choose randomly between left and right, then turn that direction.
That's not all we did. We also included a method for the ingredient to freeze when the player runs into it (this would happen only from the left, right or behind). This way the player could move it out of the way when they go for the plate. All of the methods we included this session were simple, but they create a better experience for the player. We do this by giving the A.I. a better feel and creating opportunities for the player to move freely around the map.
Comments