# Sandbox.Sprite.GetAnimation

## Overload 1

```csharp
Animation GetAnimation(int index)
```

Get an animation by its index. Returns null if out of bounds.

### Parameters

- `index` (`int`): The index of the animation

### Returns

`Animation`

## Overload 2

```csharp
Animation GetAnimation(string name)
```

Get an animation by its name. Returns null if not found.

### Parameters

- `name` (`string`): The name of the animation

### Returns

`Animation`

Declared in [Sandbox.Sprite](/api/Sandbox.Sprite).
Assembly: `Sandbox.Engine`.
