# GetNavMeshLayerFromName(string)

> Returns the layer index for a named layer.

## Definition

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

> **Warning:**
>
> **Deprecated.** Use GetAreaFromName instead.

```csharp
public static int GetNavMeshLayerFromName(string layerName)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Returns

| Type                                                       | Description |
| ---------------------------------------------------------- | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) |             |

### Remarks

If the named layer does not exist returns -1.
