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
- Type: Method
- Namespace: UnityEngine.Experimental.AI
- Assembly: UnityEngine.AIModule
public NavMeshLocation CreateLocation(Vector3 position, PolygonId polygon)
Parameters
Returns
Type | Description |
|---|---|
| NavMeshLocation | Object 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.