Skip to main content

NavMesh.FindClosestEdge(Vector3 sourcePosition, NavMeshQueryFilter filter)

ocate the closest NavMesh edge from a point on the NavMesh, subject to the constraints of the filter argument.

Parameters:

NameTypeDescription
sourcePositionVector3The origin of the distance query.
filterNavMeshQueryFilterA filter specifying which NavMesh areas can be passed when finding the nearest edge.

Returns:

typeDescription
booleanTrue if the nearest edge is found.
NavMeshHitresulting location

Usage

---@type Vector3
local sourcePosition;

---@type NavMeshQueryFilter
local filter;


local val0, val1 = NavMesh:FindClosestEdge(sourcePosition, filter)

nt on the nearest edge of the navmesh. This can be used to query how much extra space there is around the agent.