Navigation & pathfinding

Steer crowds toward a goal with a flow field, or route a single agent through a space with a navmesh.

Navigation answers one question: given where I am and where I want to go, which way do I move? There are two answers here. A Flow Field bakes the answer into the whole space at once, for many agents heading toward a shared goal. NavMesh Build with Pathfind computes an exact route between two points, for one agent that needs a precise path.

Flow fields

A Flow Field fills a box of space with cells, each holding an arrow pointing toward the goal along the cheapest route around obstacles. An agent reads the arrow where it is standing and moves that way. There is no per-agent searching, so it scales to thousands of movers, which makes it the tool for boids, flocks and swarm behaviour.

The grid is volumetric, so the arrows point in three dimensions: birds through a canyon, fish around a reef, drones between buildings. Agents are not confined to a ground plane.

It takes two inputs, obstacles and a goal. Obstacles can be a field — a volume, an image, or a procedural field — where anything darker than the threshold is a wall, or a collection of geometry that fills the cells it covers. The goal is a single point or many points. Set the grid's world bounds and resolution, then sample the resulting field from the agents, typically inside a Particle sim or a field-driven Expression.

Resolution is cells per axis of a three-dimensional grid, so doubling it multiplies the work by eight. If a fine solve is needed but a large stored grid is not, Resample stores the result more coarsely than it was solved.

A second output, the cost field, holds the distance to the goal at every cell. Use it to colour, fade or gate behaviour by how far an agent still has to travel.

Flow fields work when everyone shares a destination. Move the goal point and the whole flock re-steers live. For per-agent destinations, use Pathfind.

ParameterTypeDefaultWhat it does
obstaclesColor Field or CollectionObstacles: a field (dark = blocked) or Collection (geometry fills the voxels it occupies).
goalVec3 or Vec3[] or CollectionGoal position (Vec3) or multiple goals (Vec3Array/Collection).
bounds_minVec3World-space minimum corner of the navigation box.
bounds_maxVec3World-space maximum corner of the navigation box.
resolutionNumber64Grid cells per axis. The solve covers cells³ voxels, so cost climbs fast.
diagonalBooleantrueAllow 26-connected movement (through edges and corners) instead of 6-connected (faces only).
thresholdNumber0.500Voxels where the obstacle field is darker than this are blocked.
resampleBooleanfalseStore the field at a different resolution than it was solved at.
output_resolutionNumber32Cells per axis of the STORED grid. Lower than Resolution to solve finely but store cheaply.
opacityNumber1Layer opacity (0 = transparent, 1 = opaque). Editable, wirable, keyframable.

Building a NavMesh

A navigation mesh is a simplified map of the walkable surface: the floor, minus walls, ledges too steep to climb, and gaps too narrow to fit through. NavMesh Build generates one from scene geometry.

Geometry is filled into a volume, the walkable area is shrunk inward by the agent's radius so paths never hug walls too tightly, and the result is carved into connected walkable regions. Give the mesh a name so a Pathfind node can find it later.

The Agent settings describe who is walking: width, height for clearance under low ceilings, the steepest slope they will climb, and the tallest step they will take. Higher resolution captures finer detail at the cost of cook time.

Agent radius is the setting to get right first. Too small and agents clip through corners. Too large and narrow doorways vanish from the mesh entirely. Match it to the size of whatever is actually moving.

ParameterTypeDefaultWhat it does
geometryCollectionMesh geometry to convert into a navigation mesh.
mesh_idString"default"NavMesh name — Pathfind nodes reference this to query the mesh.
agent_radiusNumber0.600Agent radius for navmesh erosion
agent_heightNumber2Agent height for clearance checks
max_slopeNumber45Maximum slope angle (degrees) for walkable surfaces
max_climbNumber0.900Maximum step height for stairs/curbs
resolutionNumber64Grid resolution per axis for voxelization
bounds_sizeNumber100Size of the voxelization bounding box
opacityNumber1Layer opacity (0 = transparent, 1 = opaque). Editable, wirable, keyframable.

Pathfinding

Pathfind queries a named NavMesh and returns the shortest route between a start and an end point. Point its mesh name at the name given to NavMesh Build and wire in the two positions.

The main path output is a points polyline of waypoints to render, follow, or feed into another node. Alongside it come found, whether a route existed at all, the total path length, and the waypoint count. Drive an agent along the path, or use found to trigger fallback behaviour when somewhere is unreachable. Animate the start or end position and the path recomputes every cook, so dragging a goal around the viewport makes the route follow.

ParameterTypeDefaultWhat it does
mesh_idString"default"NavMesh name to query (must match a NavMesh Build node).
start_posVec3Start position for pathfinding (Vec3).
end_posVec3End/goal position for pathfinding (Vec3).
opacityNumber1Layer opacity (0 = transparent, 1 = opaque). Editable, wirable, keyframable.

Choosing between them

Many agents and one goal, a flock crossing a valley or fish toward food: use a flow field. One bake, and everyone steers cheaply, in three dimensions.

One agent and an exact route, a character walking to a clicked spot: use NavMesh Build into Pathfind for a precise, corner-respecting line of waypoints.

Both can coexist in the same scene, a flow field for the herd and a pathfind for the hero.

See also