NearestNavmeshPoint
The nearest point on the navigation mesh.
Where to put a spawn, a prop or an actor so that it stands on walkable ground: the point on the mesh nearest the one
given, within 2 m sideways and 4 m up or down; nil when the mesh is farther, or without a navmesh.
Syntax
Section titled “Syntax”NearestNavmeshPoint(x, y, z)| Parameter | Type | |
|---|---|---|
x |
number | metres |
y |
number | metres |
z |
number | metres |
Returns
Section titled “Returns”x, y, z - the point on the mesh; nil when none is that close
Example
Section titled “Example”local x, y, z = NearestNavmeshPoint(gx, gy, gz)if x then MoveActor(guard, x, y, z, 1.5) endSee also
Section titled “See also”GetNavmeshHeight · FindPath · the The world - clock, weather, terrain, the navmesh, the geometry group of the index
