Navmesh Surface
Updated
The scene’s walkable navmesh that agents find paths on.
- Type
comp-navmesh-surface- Script class
NavMeshSurfaceComponent- Per entity
- One
- Version
- 1.2.0
Read about it in Navigation meshes: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
agentHeight |
0. |
|
agentMaxClimb |
0 ≤ x ≤ 10 |
|
agentMaxSlope |
0. |
|
agentRadius |
0 ≤ x ≤ 5 |
|
cellHeight |
0.1 ≤ x ≤ 1 |
|
cellSize |
0.1 ≤ x ≤ 10 |
|
detail |
0 ≤ x ≤ 16 |
|
detail |
0 ≤ x ≤ 16 |
|
edgeMaxError |
0 ≤ x ≤ 3 |
|
edgeMaxLen |
0 ≤ x ≤ 50 |
|
region |
0 ≤ x ≤ 150 |
|
regionMinSize |
0 ≤ x ≤ 150 |
|
vertsPerPoly |
3 ≤ x ≤ 6, integer |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
A wandering villagerA villager picks a random reachable point near home with randomPoint, walks there with its Character Controller, rests two to five seconds on arrive, and sets off again.
Watch the villager wander around the walls, resting between walks. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(NavMeshSurfaceComponent); if (component) log(component.props);}