Navigation

Bake a navigation mesh, move agents with crowd avoidance, add links, area modifiers and dynamic obstacles, support several agent sizes and rebuild at runtime.

Last updated Oct 27, 2026Edit this pageVersion 1.0.0

Agents find their way over a navigation mesh baked from the level with Recast, and move with Detour's crowd steering, which adds local avoidance so agents walk round each other.

Bake the navigation mesh

Open the Navigation panel and click Build navigation. The bake walks every mesh and terrain in the scene, and leaves out holes painted in a terrain. Place an ANavMeshBoundsVolume to limit the bake to where agents walk; with none, the whole level is baked. ANavMeshBoundsVolume

The result is saved beside the scene as <scene>.navmesh and loaded with it in the editor and the packaged game. NavMeshAsset

Mowo Editor Navigation panel next to the viewport: Generation settings (Cell size, Cell height), an Agent types list with Human and Large rows showing radius, height, step and slope, the Build navigation button, and the viewport showing the baked navmesh as a green overlay over the floor
Bake settings, agent types and the baked mesh overlaid on the level.
SettingDefaultMeaning
cellSize, cellHeight0.3, 0.2Voxel resolution of the bake
agentRadius, agentHeight0.6, 2.0The agent capsule
agentMaxClimb, agentMaxSlopeDeg0.4, 45Tallest step and steepest slope
tiled, tileSizeoff, 32Bake in tiles; needed for large levels and runtime rebuilds
dynamicObstaclesoffLets obstacles cut the mesh at runtime
Engine/Source/Runtime/SceneTypes/Public/Scene/NavMeshSettings.h

Tiles bake in parallel on the job system (nav.ParallelTileBake), with the same result as a serial bake.

Several agent sizes

Add agent types (name, radius, height, step, slope) in the panel. Every type is baked together and saved as <scene>.<Agent>.navmesh. An agent paths on the mesh its agentType names, else on the smallest mesh its radius fits, so a large creature never paths through a gap only a small one fits. NavMeshBuilder

Move an agent

Add a NavAgent component to the entity. NavAgentComponent

FieldDefaultMeaning
speed, angularSpeed3.5, 360Meters and degrees per second
stoppingDistance0.1How close counts as arrived
radius, height0.5, 1.8The agent's size for avoidance
agentTypeemptyWhich baked mesh to use

Set destination and hasDestination on the component to send it somewhere; arrived turns true when it gets there. From a behavior tree use the Move To task, and from Visual Scripting the AIMoveTo node. Engine/Source/Runtime/AINavigation/Public/AINavigation/VisualScriptAIMoveProvider.h

SendAgent.cpp
#include "AINavigation/NavAgentComponent.h"
#include "ECS/World.h"
#include "Math/Vec3.h"

Mowo::World* world = nullptr;
Mowo::EntityID guard = 0;

if (Mowo::NavAgentComponent* agent = world->GetComponent<Mowo::NavAgentComponent>(guard)) {
	agent->destination = Mowo::Vec3(12.0f, 0.0f, -4.0f);
	agent->hasDestination = true;
}

Without a baked mesh, agents steer in a straight line.

An agent's position is its feet: the crowd puts it on the navigation mesh surface. Place agents with their position on the floor. A capsule or cylinder primitive on an agent is drawn at the agent's radius and height, standing on that point, so a placeholder NPC is as big as the agent it avoids with. FFeetAnchoredBody

Path queries

NavAgentSystem answers path questions for gameplay: NavAgentSystem

  • RequestPathAsync(start, end, priority) queues a path search and returns an id; TakePathResult(id, waypoints) returns it when ready. At most nav.PathQueryBudget search iterations (default 2048) run per frame, so many requests at once do not cause a hitch.
  • QueryPathLength(start, end) returns a path length at once.
  • ProjectPoint(point, verticalExtent, out) snaps a point onto the mesh.

Shape the mesh

ComponentDoes
NavMeshLinkJoins two points the bake cannot connect, such as a jump down or a ladder; endA, endB, radius, bidirectional NavMeshLinkComponent
NavMeshModifierOverrides the area type of its entity's geometry, for example to make a hazard costly NavMeshModifierComponent
NavMeshObstacleA cylinder or box that cuts the mesh at runtime; needs dynamicObstacles NavMeshObstacleComponent

Rebuild at runtime

On a tiled mesh, the rebuild system watches for static geometry that moved, appeared or disappeared, and rebakes the touched tiles on a worker once things settle. Gameplay can mark an area dirty itself, for a door or a deployed barricade. NavMeshRebuildSystem

Console variableDefaultEffect
nav.Rebuild1Runtime rebuild on or off
nav.Rebuild.SettleTime0.3Seconds the change must stay still
nav.Rebuild.MaxDelay2.0Rebuild anyway after this long
nav.Rebuild.MaxTiles16Tiles per pass
nav.UseCrowd10 uses single-agent path following without avoidance

Engine sources

This page describes behavior implemented in these files of the engine repository, checked against commit dc043afc1.

  • Engine/Source/Runtime/AINavigation/Public/AINavigation/NavAgentComponent.h
  • Engine/Source/Runtime/AINavigation/Public/AINavigation/NavAgentSystem.h
  • Engine/Source/Runtime/AINavigation/Public/AINavigation/NavMeshBuilder.h
  • Engine/Source/Runtime/AINavigation/Public/AINavigation/NavMeshAsset.h
  • Engine/Source/Runtime/AINavigation/Public/AINavigation/NavMeshRebuildSystem.h
  • Engine/Source/Runtime/AINavigation/Public/AINavigation/NavMeshObstacleSystem.h
  • Engine/Source/Runtime/AINavigation/Public/AINavigation/ANavMeshBoundsVolume.h
  • Engine/Source/Runtime/AINavigation/Public/AINavigation/VisualScriptAIMoveProvider.h
  • Engine/Source/Runtime/Game/Public/Game/FeetAnchoredBody.h
  • Engine/Source/Runtime/SceneTypes/Public/Scene/NavMeshSettings.h
  • Engine/Source/Runtime/Game/Public/Game/Components/NavMeshLinkComponent.h
  • Engine/Source/Runtime/Game/Public/Game/Components/NavMeshModifierComponent.h
  • Engine/Source/Runtime/Game/Public/Game/Components/NavMeshObstacleComponent.h

Page feedback

Was this page helpful?