Navigation & pathfinding
Steer crowds toward a goal, or route a single agent through a space — DNA gives you two complementary tools for getting things to move intelligently.
Navigation answers one question: given where I am and where I want to go, which way do I move? DNA solves it two ways. A Flow Field bakes the answer into the whole space at once — perfect for many agents heading for a shared goal. NavMesh Build + Pathfind computes an exact route between two points — perfect when one agent needs a precise path.
Flow Fields — steering for crowds
A simulation.flow_field turns your space into a grid where every cell stores a little arrow pointing toward the goal along the cheapest route around obstacles. Any agent just reads the arrow under its feet and moves that way — no per-agent searching, so it scales effortlessly to thousands of movers. This is the go-to for boids, crowds, and swarm behaviour.
You feed it two things: obstacles and a goal. Obstacles can be a raster (dark pixels are walls) 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 your agents — typically inside a Particle sim or an field-driven Expression.
| Parameter | Type | Default |
|---|---|---|
obstacles | OneOf([FieldOf(Color), Collection]) | — |
goal | OneOf([Vec3, Vec3Array, Collection]) | — |
bounds_min | OneOf([Vec3]) | — |
bounds_max | OneOf([Vec3]) | — |
resolution | Number | 64 |
diagonal | Boolean | true |
threshold | Number | 0.500 |
rasterize | Boolean | false |
raster_width | Number | 512 |
raster_height | Number | 512 |
opacity | Number | 1 |
The node also gives you a cost field output — the distance-to-goal at every cell — which is handy for colouring, fading, or gating behaviour by how far an agent still has to travel.
Flow Fields shine when everyone wants the same destination. Move the goal point and the whole crowd re-steers live. For per-agent destinations, reach for Pathfind instead.
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. simulation.navmesh_build generates one automatically from your scene geometry.
It works by filling your geometry into a volume, shrinking the walkable area inward by the agent's radius (so paths never hug walls too tightly), then carving the result into connected walkable regions. You give the mesh a name so a Pathfind node can find it later.
| Parameter | Type | Default |
|---|---|---|
geometry | OneOf([Collection]) | — |
mesh_id | String | "default" |
agent_radius | Number | 0.600 |
agent_height | Number | 2 |
max_slope | Number | 45 |
max_climb | Number | 0.900 |
resolution | Number | 64 |
bounds_size | Number | 100 |
opacity | Number | 1 |
The Agent settings describe who's walking: how wide they are, how tall (for clearance under low ceilings), the steepest slope they'll climb, and the tallest step they'll take. Higher resolution captures finer detail at the cost of more cook time.
The agent radius is the most important knob to get right. Too small and agents clip through corners; too large and narrow doorways vanish from the mesh entirely. Tune it to match the size of whatever is actually moving.
Pathfinding
simulation.pathfind queries a named NavMesh and returns the shortest route between a start and an end point. Point its mesh name at the same name you gave NavMesh Build, wire in the two positions, and it hands back a clean path.
| Parameter | Type | Default |
|---|---|---|
mesh_id | String | "default" |
start_pos | OneOf([Vec3]) | — |
end_pos | OneOf([Vec3]) | — |
opacity | Number | 1 |
The main path output is a points polyline — a tidy line of waypoints you can render, follow, or feed into another node. Alongside it you get found (did a route exist 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 — drag a goal around the viewport and watch the route snake to follow it.
Which one do I want?
Many agents, one goal (a crowd flowing to an exit, fish toward food): use a Flow Field. One bake, everyone steers cheaply.
One agent, exact route (a character walking to a clicked spot): use NavMesh Build → Pathfind. You get a precise, corner-respecting line of waypoints.
Both can coexist — a flow field for the herd, a pathfind for the hero.
See also
Particles — the usual home for agents that sample a flow field
Fields — how fields are sampled across space
Fields & sampling — reading a field at a point
Forces & collisions — combining steering with physical forces
Queries (sim-free) — triggers and collision tests for agent logic