# NavMeshLocation

> A world position that is guaranteed to be on the surface of the NavMesh.

## Definition

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

> **Warning:**
>
> **Deprecated.** The experimental NavMeshLocation struct has been deprecated. Use NavLocation instead.

```csharp
public struct NavMeshLocation
```

## Remarks

The NavMeshLocation stores the position on the NavMesh surface together with the [PolygonId](/engine/6000.6/script-reference/unityengine/experimental/ai/polygonid.md) of the NavMesh node containing that position. Using NavMeshLocations with [NavMeshQuery](/engine/6000.6/script-reference/unityengine/experimental/ai/navmeshquery.md) operations remove the need to project the desired world position onto the NavMesh at the beginning of each and every operation.

A NavMeshLocation can be invalid in two situations:

1. When it has been created empty, instead of being the result of a [NavMeshQuery](/engine/6000.6/script-reference/unityengine/experimental/ai/navmeshquery.md) operation.
2. When the NavMesh has been removed or modified at the indicated position or in its close vicinity.

If a NavMeshLocation is made invalid by a [NavMeshObstacle](/engine/6000.6/script-reference/unityengine/ai/navmeshobstacle.md) carving the NavMesh in its vicinity the NavMeshLocation returns to a valid state if the [NavMeshObstacle](/engine/6000.6/script-reference/unityengine/ai/navmeshobstacle.md) is removed. This is because removing a [NavMeshObstacle](/engine/6000.6/script-reference/unityengine/ai/navmeshobstacle.md) restores the NavMesh to its original form without regenerating it.

Additional Resources: [NavMeshQuery.MapLocation](/engine/6000.6/script-reference/unityengine/experimental/ai/navmeshquery/maplocation.md), [NavMeshQuery.IsValid](/engine/6000.6/script-reference/unityengine/experimental/ai/navmeshquery/isvalid.md), [PolygonId](/engine/6000.6/script-reference/unityengine/experimental/ai/polygonid.md)

## Properties

| Property                                                                                            | Description                                                                                |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [polygon](/engine/6000.6/script-reference/unityengine/experimental/ai/navmeshlocation/polygon.md)   | Unique identifier for the node in the NavMesh to which the world position has been mapped. |
| [position](/engine/6000.6/script-reference/unityengine/experimental/ai/navmeshlocation/position.md) | A world position that sits precisely on the surface of the NavMesh or along its links.     |
