# CreateLocation(Vector3, PolygonId)

> Returns a valid NavMeshLocation for a position and a polygon provided by the user.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Experimental.AI](/engine/6000.3/script-reference/unityengine/experimental/ai.md)
* **Assembly:** UnityEngine.AIModule

> **Warning:**
>
> **Deprecated.** The experimental NavMeshQuery struct has been deprecated without replacement.

```csharp
public NavMeshLocation CreateLocation(Vector3 position, PolygonId polygon)
```

### Parameters

**** (\[Vector3]\(/engine/6000.3/script-reference/unityengine/vector3)): World position of the [NavMeshLocation](/engine/6000.3/script-reference/unityengine/experimental/ai/navmeshlocation.md) to be created.**** (\[PolygonId]\(/engine/6000.3/script-reference/unityengine/experimental/ai/polygonid)): Valid identifier for the NavMesh node.

### Returns

| Type                                                                                              | Description                                              |
| ------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| [NavMeshLocation](/engine/6000.3/script-reference/unityengine/experimental/ai/navmeshlocation.md) | 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](/engine/6000.3/script-reference/unityengine/experimental/ai/navmeshquery/maplocation.md), [NavMeshQuery.MoveLocation](/engine/6000.3/script-reference/unityengine/experimental/ai/navmeshquery/movelocation.md) and [NavMeshQuery.GetPortalPoints](/engine/6000.3/script-reference/unityengine/experimental/ai/navmeshquery/getportalpoints.md).
