Bake a navmesh in the editor
site/media/lessons/learn-navmesh.lesson.ts (4 steps) A navmesh is the walkable surface agents path on. In vgai you donβt author it by hand β you
tag which meshes are walkable vs obstacles, then bake with recast.
This RTS scene already tags its Ground as walkable and the blocks as obstacle.
-
A tagged scene. Each mesh has a navigation role (
none/walkable/obstacle), set per entity in the inspectorβs Navigation section. HereGroundis walkable and the six blocks are obstacles.
Ground tagged walkable; blocks tagged obstacle. -
The bake parameters. With nothing selected, Scene Settings β Navigation exposes the recast knobs β cell size/height, walkable slope/height/climb/radius, edge length, region areas β and the Bake NavMesh button.
The recast parameters live in Scene Settings β Navigation. -
Bake. Clicking Bake NavMesh initialises the recast WASM, collects the walkable meshes, and builds the navmesh β which appears as an overlay in the viewport (the ground turns into the navmesh surface).
The baked navmesh, drawn over the walkable ground. -
The result. The navmesh covers the walkable ground; the obstacle-tagged blocks are excluded from it, so agents path around them.
Obstacles are excluded from the walkable surface.
Recap
New functionality
- Saw walkable/obstacle tags on a scene
- Baked a navmesh and saw it overlay the viewport
New concepts & skills
- meshes carry a navigation role: none / walkable / obstacle
- recast bakes from environment.navigation params (cell size, slope, agent radius, β¦)
- the bake writes a .navmesh next to the scene; the runtime loads it for pathfinding
Next lesson β Editor architecture
On Your Own!
Extend what you built:
- Lower Walkable Radius and re-bake β the navmesh hugs obstacles more tightly
- Tag a ramp as walkable and bake β the navmesh climbs it (within Walkable Slope Angle)
- Hit Clear, change Cell Size, and re-bake to see the resolution change