# GetLayerIndex(string)

> Returns the index of the layer with the given name.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AnimationModule

```csharp
public int GetLayerIndex(string layerName)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The layer name.

### Returns

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