# GetNavMeshAreaFromName(string)

> Get the navmesh area index from the area name.

## Definition

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

> **Warning:**
>
> **Deprecated.** GetNavMeshAreaFromName has been deprecated. Use NavMesh.GetAreaFromName instead.
>
> **Upgrade to** [NavMesh.GetAreaFromName](/engine/6000.0/script-reference/unityengine/ai/navmesh/getareafromname.md)

```csharp
public static int GetNavMeshAreaFromName(string name)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): NavMesh area name to query.

### Returns

| Type                                                       | Description                                                                                          |
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The NavMesh area index. If there is no NavMesh area with the requested name, the return value is -1. |
