Tutorial work - Navmesh and raycasting


These ghosts have been given agency by using a navigation mesh, so they can find their way around the world and attempt to arrive at a specified destination, this is similar to giving them a map of all the places they are allowed to go.

However sometimes the world changes, so they will have to navigate around moving objects, we do this by defining certain objects as moving obstacles.
Obstacles are not the only dynamic feature of a navmesh, we can also set them a dynamic goal to move towards, in this case it is the player.


In this video the navmesh agents are being spawned by clicking on a screen, this was achieved by shooting a laser or "ray" out from the camera, and finding out where in the game world it lands, then taking those coordinates and placing something there, in this case a ghost npc.

(note that the barrels on the bridge are not marked as obstacles, so the ghosts will not attempt to move around them)

Leave a comment

Log in with itch.io to leave a comment.