Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


CreateLocation(Vector3, PolygonId)

Returns a valid NavMeshLocation for a position and a polygon provided by the user.
Read time 1 minuteLast updated 12 days ago

Definition

Warning
Deprecated. The experimental NavMeshQuery struct has been deprecated without replacement.
public NavMeshLocation CreateLocation(Vector3 position, PolygonId polygon)

Parameters

position

World position of the NavMeshLocation to be created.

polygon

Valid identifier for the NavMesh node.

Returns

Type

Description

NavMeshLocationObject containing the desired position and NavMesh node.

Remarks

The returned position will be the point on the surface of the required NavMesh polygon that is closest to the specified position.
Other methods for obtaining reliable positions on the NavMesh are: NavMeshQuery.MapLocation, NavMeshQuery.MoveLocation and NavMeshQuery.GetPortalPoints.