Navmesh Obstacle Component
The Navmesh Obstacle component (plNavMeshObstacleComponent) requests regeneration of sectors affected by changes to an object's physics geometry. Use it for placed buildings, moved crates, or geometry that appears or disappears.
Setup
Add the component to an object with a physics collider. The collider must be visible to the collision layer of the affected navmesh configuration. The component queries the owner's physics bounds, including child geometry.
Static owners contribute their collision geometry directly to the navmesh build. Dynamic owners are represented by a bounds-based carve volume because ordinary dynamic physics geometry is not collected as static navmesh input. The component registers or removes that volume as it activates or deactivates.
Moving dynamic owners are tracked automatically. MoveThreshold controls how far the bounds must change before another invalidation; ReinvalidateCooldown limits how frequently movement can trigger rebuilding. Changes are asynchronous, so an agent may briefly still see the old route. Use crowd avoidance for continuously moving characters.
Properties and functions
| Property | Purpose |
|---|---|
Mode | Block removes walkable space; Avoid creates a traversable area with a higher path cost. |
MoveThreshold | Movement threshold for automatic invalidation (default 0.5 m). |
ReinvalidateCooldown | Minimum interval between movement-triggered invalidations (default 0.5 s). |
InvalidateSectors() refreshes the obstacle volume and invalidates affected sectors explicitly. Use it after a change your gameplay code makes that needs an immediate invalidation request. It does not synchronously finish rebuilding.
Avoid uses AI.Navmesh.AvoidZoneCost (default 10). It replaces the ground type inside the avoidance volume; do not rely on the original ground-type filter being preserved there. Static solid geometry still contributes to the build, so Avoid does not make a solid wall walkable.
Choose the right tool
Use an AI Nav Blocker for a door or danger zone that toggles permissions on existing walkable space. Use Navmesh Obstacle when the shape of that space changes. Supported destructible-change events also invalidate navmesh sectors through an automatically created destruction-response component; a separate response component is not required for each object.