---
title: CreateLocation(Vector3, PolygonId)
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/experimental/ai/navmeshquery/createlocation
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/experimental/ai/navmeshquery/createlocation.md
last_updated: 2026-10-07
generated_at: 2026-11-10T18:23:21.070Z
locale: en-us
---

# 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/7000.0/script-reference/unityengine/experimental/ai.md)
* **Assembly:** UnityEngine.AIModule

> **Warning:**
>
> **Deprecated.** The experimental NavMeshQuery struct has been deprecated. Use NavWorld instead.

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

### Parameters

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

### Returns

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