# HasState(int, int)

> Returns true if the state exists in this layer, false otherwise.

## Definition

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

```csharp
public bool HasState(int layerIndex, int stateID)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The layer index.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The state ID.

### Returns

| Type                                                          | Description                                              |
| ------------------------------------------------------------- | -------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the state exists in this layer, false otherwise. |
