menu_bookDocumentation
NavMesh Areas — blocking and cost-modifying regions for AI pathfinding
NavMesh Areas
NavMeshArea components modify NavMesh generation and agent pathfinding costs within a defined region. Use them to create no-go zones, water areas, or danger zones that agents prefer to avoid.NavMeshAreaDefinition Resource
Create a NavMeshAreaDefinition asset to define the area's properties (cost, color, name). There is a limit of 24 NavMeshAreaDefinition assets per project, but you can assign them to as many NavMeshArea components as needed.
NavMeshArea Component
Add a NavMeshArea component to a GameObject to define the location and shape of the area:
CSHARP
var go = Scene.CreateObject();
go.WorldPosition = dangerZoneCenter;
var area = go.Components.Create<NavMeshArea>();
area.IsBlocker = true; // true = completely blocks NavMesh generation hereBlocker vs Cost Area
- IsBlocker = true — removes NavMesh from this region entirely. Agents cannot path through it.
- IsBlocker = false — keeps NavMesh but applies a cost multiplier from the NavMeshAreaDefinition. Agents will avoid it if a cheaper path exists.
Assigning to a NavMeshLink
Areas can also be assigned to NavMeshLink components to mark the traversal type (e.g. a jump link in a "Jump" area):
CSHARP
var link = go.Components.Create<NavMeshLink>();
link.Area = jumpAreaDefinition;Performance
- Static areas are essentially free — baked into the NavMesh
- Moving areas (on moving GameObjects) have a small runtime cost; you can have dozens without issue
Was this helpful?