Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IsValid

Returns true if the node referenced by the specified PolygonId is active in the NavMesh.
Read time 1 minuteLast updated 12 days ago

Definition

IsValid(PolygonId)

Returns true if the node referenced by the specified PolygonId is active in the NavMesh.
Warning
Deprecated. The experimental NavMeshQuery struct has been deprecated. Use NavWorld instead.
public bool IsValid(PolygonId polygon)

Parameters

polygon

Identifier of the NavMesh node to be checked.

Returns

Type

Description

bool

Remarks

You can make NavMesh nodes invalid when you remove the NavMesh surface or the links they belong to, or when you modify the NavMesh in their region, replacing them. You can remove the NavMesh surface and links with calls to NavMesh.RemoveNavMeshData, NavMesh.RemoveLink. To modify the NavMesh, call UpdateNavMeshData or use a NavMeshObstacle to carve it.

IsValid(NavMeshLocation)

Returns
true
if the node referenced by the PolygonId contained in the NavMeshLocation is active in the NavMesh.
Warning
Deprecated. The experimental NavMeshQuery struct has been deprecated. Use NavWorld instead.
public bool IsValid(NavMeshLocation location)

Parameters

Location on the NavMesh to be checked. Same as checking
location.polygon
directly.

Returns

Type

Description

bool