# SetNavMeshArea(GameObject, int)

> Set the navmesh area for the gameobject.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.5/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

> **Warning:**
>
> **Deprecated.** SetNavMeshArea has been deprecated. To relate a GameObject to an area type, create a NavMeshBuildMarkup and pass it into UnityEngine.AI.NavMeshBuilder.CollectSources().

```csharp
public static void SetNavMeshArea(GameObject go, int areaIndex)
```

### Parameters

**** (\[GameObject]\(/engine/6000.5/script-reference/unityengine/gameobject)): GameObject to modify.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): NavMesh area index to set.
