Setting Up A Navigation Mesh
A navigation mesh is a bunch of precalculated shapes compiled with a map that let NPCs and other entities navigate around.
- In Hammer, in your map, create a
func_nav_markupentity somewhere where you want the navmesh to be generated (it just has to be in a small part, it doesn't have to cover the entire area).
On that entity, make sure
Walkable Seedis ticked.
Build your map with
Build navenabled, and you are done.
Navmesh hulls represent that fact that different NPCs might have different sized "hulls". Imagine a cat, a human and an elephant - they are all different sizes of creature and so are able to navigate different kinds of spaces.
You can configure the hulls in Hammer by going to
Navigation and ticking
Use Custom Generation Params, but you usually don't need to. The default hull used is hull 0 which is the medium-sized hull (for humans and such).
You can control which hull is used through code:
Once you have added the
func_nav_markup you can preview what your navigation mesh will look like in Hammer by going to
The preview shows the passable space of each hull as a separate shade of blue.
Generally the preview should match how your navmesh behaves in-game, but if you are encountering problems, you can double-check by using the command
nav_edit 1 in-game. You can then cycle through the different hulls by running
nav_select_hull 1 and