Prowl’s navigation system is built on DotRecast, a C# port of the industry-standard Recast & Detour libraries. Two components handle everything:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl/llms.txt
Use this file to discover all available pages before exploring further.
NavMeshSurface bakes walkable polygonal mesh data from your scene geometry and manages a DtCrowd simulation, while NavMeshAgent registers a moving entity with that crowd and drives the GameObject’s transform along the computed path. Because the underlying library is the same technology used in major commercial engines, you get proven tile-based pathfinding and local obstacle avoidance out of the box.
NavMeshSurface
NavMeshSurface is the scene component that owns the baked navigation data. You add it to any GameObject in the scene (the transform of this object defines the local coordinate space used when building the mesh), configure its BuildSettings, point it at source geometry, then press Rebuild in the Inspector.
Build Settings
All build parameters live inNavMeshSurface.BuildSettings, exposed in the Inspector under navSettings.
| Property | Default | Description |
|---|---|---|
cellSize | 0.3 | Horizontal voxel resolution (metres). Smaller = finer mesh, higher cost. |
cellHeight | 0.2 | Vertical voxel resolution (metres). |
agentHeight | 1.0 | Minimum clearance above the floor the agent requires (metres). |
agentRadius | 0.5 | Distance from the agent centre to the nearest wall (metres). |
agentMaxClimb | 0.9 | Maximum step height the agent can climb (metres). |
agentMaxSlope | 45.0 | Maximum walkable slope (degrees). |
agentMaxAcceleration | 8.0 | Crowd acceleration (m/s²). |
agentMaxSpeed | 3.5 | Default crowd maximum speed (m/s). |
tileSize | 32 | Tile width/height in voxel cells. |
minRegionSize | 8 | Smallest valid walkable region (voxels²). |
mergedRegionSize | 20 | Regions smaller than this are merged with neighbours. |
agentRadius and agentHeight are baked into the mesh at build time. If you have agents of very different sizes, create separate NavMeshSurface components with different settings on the same scene.Source Geometry
NavMeshSurface supports two geometry source modes, selected by the useStaticGeometry toggle.
- Static Rigidbodies (default)
- Mesh Renderers
Collect
Rigidbody3D components and extract their collider geometry (box, sphere, cylinder, capsule). This avoids loading separate visual meshes and stays in sync with the physics setup.Baking the NavMesh
Add NavMeshSurface
Add NavMeshSurface to a scene-level
GameObject. The origin of this object becomes the local coordinate frame for pathfinding.Populate geometry
Click Add All Geometry in the Inspector to auto-fill
staticGeometry (or meshGeometry) with every eligible object in the open scene.Tune build settings
Adjust
agentRadius, agentHeight, agentMaxSlope, and cellSize to match the characters that will walk this surface.NavMeshAgent
NavMeshAgent attaches to any GameObject that should navigate the baked mesh. During LateUpdate, it reads the crowd-simulated position from the DtCrowdAgent and writes it straight to Transform.position.
Properties
Assigning a Surface
EachNavMeshAgent must reference the NavMeshSurface it navigates. Set the Surface property in the Inspector or at runtime:
Surface is set, the agent is automatically registered with the crowd (NavMeshSurface.RegisterAgent) as soon as the surface is ready. On OnDisable the agent is cleanly unregistered.
Moving to a Destination
UseNavMeshSurface.MoveToTarget to send a specific agent to a world-space position. Because the nav mesh is built in the surface’s local coordinate space, convert the world-space destination first:
adjust: true asks the crowd to match a target velocity rather than seek a point — useful for kinematic steering or formation movement.
Complete Example: Enemy Following the Player
The following script ties together everything covered above. The enemy uses aNavMeshAgent to chase the player, updating the destination every second to keep the path fresh without hammering the crowd each frame.
Setting up the scene
Setting up the scene
Bake the surface
Add a
NavMeshSurface to an empty root GameObject, populate geometry, and click Rebuild.Add NavMeshAgent to the enemy
Add the NavMeshAgent component to your enemy
GameObject. Assign the NavMeshSurface reference in the Inspector.Architecture Reference
DotRecast (Recast)
Voxelises geometry, partitions regions, and builds the polygon navigation mesh. Invoked during
RebuildNavMesh() via RcBuilder.BuildTiles.DotRecast (Detour)
A* pathfinding on the tiled polygon mesh.
DtNavMeshQuery finds nearest polygons and computes straight-path corridors for each agent.DtCrowd
Simulates all registered agents simultaneously, handling local steering, collision avoidance, and velocity smoothing. Updated every frame inside
NavMeshSurface.Update.NavMeshSurface
Prowl wrapper that owns the
DtNavMesh, DtNavMeshQuery, and DtCrowd instances, exposes the BuildSettings struct, and bridges agent transforms to the crowd simulation.