Level Editor/Entities/Nav Region
| Nav Region | |
|---|---|
| Made with | Functional > Nav Region; bake with Functional > Bake Selected NavRegion |
| What it is | A box that says where bots can walk, baked into a navigation mesh |
| In the game | Yes, it is exported with the map |
A Nav Region is a box that tells the editor where to work out the ground bots can walk on. The editor bakes the floors inside the box into a navigation mesh: the walkable area, with walls, ledges and obstacles cut out, sized for a player. Without one, bots cannot find their way round the map.
How to set up a whole map for bots is on Bots and navigation.
Placing and baking
- Choose Functional > Nav Region. Set its Name and Extents in Tool Properties first if you like.
- Click to place it. A translucent box shows its extents.
- Move it and resize its Extents so the box covers every floor bots should use.
- Select it and choose Functional > Bake Selected NavRegion. With no region selected, every region in the map is baked. The status line says Baked N NavRegion(s), M polys total.
The baked mesh shows in the viewport. Several regions may overlap or touch: the game joins them into one network. View > Show Nav Region Volumes shows or hides the boxes.
The bake is sized for the game's player (its width, height, step height and the steepest slope it can walk), so you do not set any of that.
Tool settings
| Setting | Type | Default | What it does |
|---|---|---|---|
| Name | Text | NavRegion | The new region's name. |
| Extents (world AABB filter) X, Y, Z | Metres, 0.5 to 4096 | 40, 8, 40 | The new region's box size. |
After placing, select the region and use Functional → Bake Selected NavRegion to bake. Region, edge and detail settings live on the region's inspector.
Inspector
| Setting | Type | Default | What it does |
|---|---|---|---|
| Region Name | Text | empty | The region's name in the exported map. |
| Bake On Export | Check box | On | Bake again from the current geometry whenever you export, so the navigation always matches the map. Off exports the last bake as it is; only turn it off for a reason, and bake first. |
| Extents | Metres (X, Y, Z) | 40, 8, 40 | The size of the box. Only geometry inside it is baked. |
| Border Size | 0 to 1024 | 0 | Cell. A margin kept clear round the edge of the bake. |
| Region Min Size | 0 to 150 | 2 | Region. Islands of walkable area smaller than this are dropped (tops of crates and fences, for example). |
| Edge Max Length | 0 to 50 | 12 | Edges & Polygon. The longest edge along the outline of the walkable area. |
| Edge Max Error | 0.1 to 3 | 1.3 | Edges & Polygon. How far the outline may stray from the true edge of the floor. Lower is more exact and heavier. |
| Verts Per Polygon | 3 to 12 | 6 | Edges & Polygon. The most corners one navigation polygon may have. |
| Filter Low Hanging Obstacles | Check box | Off | Filter. Treat low obstacles a player can step over as walkable. |
| Filter Ledge Spans | Check box | Off | Filter. Remove the edges of drops, so bots do not walk along the very rim. |
| Filter Walkable Low Height Spans | Check box | Off | Filter. Remove floor with too little headroom for a player. |
| Navigation Layers | Layers | 1 | Layers. Which navigation layers the region is on. Leave at 1. |
Tips
- A Nav Region inside a moving platform rides with it.
- Doors and team gates are handled for you at export: their doorways become pieces of navigation the game opens and shuts. See Door.
- A terrain with Generate Navmesh on is baked at export too.