---
name: AnimationPlayer
last_updated: 2026-12-03T00:17:38Z
inherits:
  - Instance
  - Object
type: class
memory_category: Animation
summary: "Plays back Content such as an `AnimatedImage`."
---

# Class: AnimationPlayer

> Plays back [Content](/docs/reference/engine/classes/Content.md) such as an `AnimatedImage`.

## Description

`AnimationPlayer` plays back animation [Content](/docs/reference/engine/classes/Content.md) assigned to
[AnimationPlayer.AnimationContent](/docs/reference/engine/classes/AnimationPlayer.md), such as an `AnimatedImage` which
drives its parent [ImageLabel](/docs/reference/engine/classes/ImageLabel.md).

Use [Play()](/docs/reference/engine/classes/AnimationPlayer.md),
[Pause()](/docs/reference/engine/classes/AnimationPlayer.md), and
[Stop()](/docs/reference/engine/classes/AnimationPlayer.md) to control playback, and the
[Ended](/docs/reference/engine/classes/AnimationPlayer.md) and
[Stopped](/docs/reference/engine/classes/AnimationPlayer.md) events to respond to it. Named
playback parameters, such as the active clip, are read and written with
[GetParameter()](/docs/reference/engine/classes/AnimationPlayer.md) and
[SetParameter()](/docs/reference/engine/classes/AnimationPlayer.md).

Use [AnimationClipProvider](/docs/reference/engine/classes/AnimationClipProvider.md) to inspect or author the clips and frames
contained in `AnimatedImage` content.

#### AnimatedImage assets

`AnimatedImage` is an asset type for frame-based 2D animation. An
`AnimatedImage` asset holds the animation's frames along with the named clips
that group them.

You can create an `AnimatedImage` from these sources:

- **Aseprite file** (`.aseprite` or `.ase`) — Import it in Studio, or upload
  it with the Open Cloud [Assets API](/docs/en-us/cloud/guides/usage-assets.md).
- **GIF file** — Import it in Studio, or upload it with the Open Cloud
  [Assets API](/docs/en-us/cloud/guides/usage-assets.md).
- **Image sequence** — Import it in Studio. Image sequences are only supported
  in Studio.

Once it's uploaded, assign the asset to
[AnimationContent](/docs/reference/engine/classes/AnimationPlayer.md) to play it back.

## Properties

### Property: AnimationPlayer.AnimationContent

```json
{
  "type": "Content",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": true,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Animation"
}
```

The animation content to play, such as an `AnimatedImage` asset. Use
[AnimationClipProvider](/docs/reference/engine/classes/AnimationClipProvider.md) to inspect or author the clips and frames
contained in this content.

### Property: AnimationPlayer.AutoPlay

```json
{
  "type": "boolean",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": true,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Playback"
}
```

Determines whether the animation starts playing automatically once
[AnimationContent](/docs/reference/engine/classes/AnimationPlayer.md) has loaded,
without a script needing to call [Play()](/docs/reference/engine/classes/AnimationPlayer.md).
Defaults to `true`.

In Studio, autoplay for every `AnimationPlayer` in the place can be turned
off at edit time from the visualization settings menu, without changing
this property.

### Property: AnimationPlayer.Enabled

```json
{
  "type": "boolean",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": true,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Playback"
}
```

Determines whether the `AnimationPlayer` is active. Defaults to `true`.

### Property: AnimationPlayer.IsPlaying

```json
{
  "type": "boolean",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": false,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Playback"
}
```

Indicates whether the animation is currently playing. Use
[Play()](/docs/reference/engine/classes/AnimationPlayer.md),
[Pause()](/docs/reference/engine/classes/AnimationPlayer.md), and
[Stop()](/docs/reference/engine/classes/AnimationPlayer.md) to control playback.

### Property: AnimationPlayer.Loop

```json
{
  "type": "boolean",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": true,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Playback"
}
```

Determines whether the animation restarts from the beginning after it
finishes playing, rather than firing [Ended](/docs/reference/engine/classes/AnimationPlayer.md)
and stopping. Defaults to `true`.

### Property: AnimationPlayer.Speed

```json
{
  "type": "float",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": true,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Playback"
}
```

A multiplier applied to the animation's playback rate. Defaults to `1.0`,
meaning normal speed. Values greater than `1.0` play back faster than
normal, and values between `0.0` and `1.0` play back slower. A negative
value plays the animation in reverse, starting from the end of the clip.

### Property: AnimationPlayer.TimePosition

```json
{
  "type": "double",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": false,
    "can_save": false
  },
  "thread_safety": "ReadSafe",
  "category": "Playback"
}
```

The current playback position, in seconds, within the active clip. Setting
this property seeks playback to the given position.

## Methods

### Method: AnimationPlayer:GetParameter

**Signature:** `AnimationPlayer:GetParameter(name: string): Variant`

Returns the current value of a named parameter.

#### AnimatedImage

An `AnimatedImage` asset always provides these parameters:

- `"Clip"` — The name of the active clip. Defaults to the first clip in
  the `AnimatedImage`.
- `"CurrentFrame"` — The `1`-based index of the frame currently displayed.

`"CurrentFrame"` reflects the current playback state. It's not replicated
or serialized, so each client and server tracks its own value.

*Security: None · Thread Safety: Unsafe*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `name` | `string` |  | The name of the parameter to get. |

**Returns:** `Variant` — The current value of the named parameter.

### Method: AnimationPlayer:Pause

**Signature:** `AnimationPlayer:Pause(): ()`

Pauses playback at the current position. Call
[Play()](/docs/reference/engine/classes/AnimationPlayer.md) to resume from where playback was
paused.

*Security: None · Thread Safety: Unsafe*

**Returns:** `()`

### Method: AnimationPlayer:Play

**Signature:** `AnimationPlayer:Play(): ()`

Starts or resumes playback. After [Pause()](/docs/reference/engine/classes/AnimationPlayer.md),
playback resumes from the current
[TimePosition](/docs/reference/engine/classes/AnimationPlayer.md). After
[Stop()](/docs/reference/engine/classes/AnimationPlayer.md), or once a non-looping animation has
finished, playback restarts from the beginning of the clip, or from the
end if [Speed](/docs/reference/engine/classes/AnimationPlayer.md) is negative.

Playback isn't synchronized between the server and clients. Each one runs
its own playback, so the frame shown can differ between clients.

*Security: None · Thread Safety: Unsafe*

**Returns:** `()`

### Method: AnimationPlayer:SetParameter

**Signature:** `AnimationPlayer:SetParameter(name: string, value: Variant): ()`

Sets a named playback parameter to `value`. Calling this method with
`value` omitted, or set to `nil`, clears any override previously set
through this method for `name`.

#### AnimatedImage

Set `"Clip"` to the name of a clip to make it the active clip, or set
`"CurrentFrame"` to a frame index to seek playback to that frame. See
[GetParameter()](/docs/reference/engine/classes/AnimationPlayer.md) for the available
parameters.

*Security: None · Thread Safety: Unsafe*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `name` | `string` |  | The name of the parameter to set. |
| `value` | `Variant` |  | The value to assign to the parameter. Defaults to an empty value, which clears any override. |

**Returns:** `()`

### Method: AnimationPlayer:Stop

**Signature:** `AnimationPlayer:Stop(): ()`

Stops playback without changing
[TimePosition](/docs/reference/engine/classes/AnimationPlayer.md), so the current frame
stays displayed. Fires [Stopped](/docs/reference/engine/classes/AnimationPlayer.md) if the
animation was playing or paused. A later call to
[Play()](/docs/reference/engine/classes/AnimationPlayer.md) restarts playback from the beginning
of the clip.

*Security: None · Thread Safety: Unsafe*

**Returns:** `()`

## Events

### Event: AnimationPlayer.Ended

**Signature:** `AnimationPlayer.Ended()`

Fires when the animation finishes playing. This only fires when
[Loop](/docs/reference/engine/classes/AnimationPlayer.md) is `false`; a looping animation never
reaches this state on its own.

*Security: None*

### Event: AnimationPlayer.Stopped

**Signature:** `AnimationPlayer.Stopped()`

Fires when [Stop()](/docs/reference/engine/classes/AnimationPlayer.md) is called.

*Security: None*

## Inherited Members

### From [Instance](/docs/reference/engine/classes/Instance.md)

- **Property `Archivable`** (`boolean`): Determines if an Instance and its descendants can be cloned using
- **Property `archivable`** (`boolean`):  *(deprecated, hidden)*
- **Property `Capabilities`** (`SecurityCapabilities`): The set of capabilities allowed to be used for scripts inside this
- **Property `IsInSandbox`** (`boolean`): Indicates whether the instance is inside a sandboxed container.
- **Property `Name`** (`string`): A non-unique identifier of the Instance.
- **Property `Parent`** (`Instance`): Determines the hierarchical parent of the Instance.
- **Property `PredictionMode`** (`PredictionMode`): Reflects the client-side prediction mode applied to the instance under
- **Property `RobloxLocked`** (`boolean`): A deprecated property that used to protect CoreGui objects. *(hidden)*
- **Property `Sandboxed`** (`boolean`): When enabled, the instance can only access abilities in its `Capabilities`
- **Property `UniqueId`** (`UniqueId`): A unique identifier for the instance.
- **Method `AddTag(tag: string): ()`**: Applies a tag to the instance.
- **Method `children(): Instances`**: Returns an array of the object's children. *(deprecated)*
- **Method `ClearAllChildren(): ()`**: This method destroys all of an instance's children.
- **Method `Clone(): Instance`**: Create a copy of an instance and all its descendants, ignoring instances
- **Method `clone(): Instance`**:  *(deprecated)*
- **Method `Destroy(): ()`**: Sets the Instance.Parent property to `nil`, locks the
- **Method `destroy(): ()`**:  *(deprecated)*
- **Method `FindFirstAncestor(name: string): Instance?`**: Returns the first ancestor of the Instance whose
- **Method `FindFirstAncestorOfClass(className: string): Instance?`**: Returns the first ancestor of the Instance whose
- **Method `FindFirstAncestorWhichIsA(className: string): Instance?`**: Returns the first ancestor of the Instance for whom
- **Method `FindFirstChild(name: string, recursive?: boolean): Instance?`**: Returns the first child of the Instance found with the given name.
- **Method `findFirstChild(name: string, recursive?: boolean): Instance`**:  *(deprecated)*
- **Method `FindFirstChildOfClass(className: string): Instance?`**: Returns the first child of the Instance whose
- **Method `FindFirstChildWhichIsA(className: string, recursive?: boolean): Instance?`**: Returns the first child of the Instance for whom
- **Method `FindFirstDescendant(name: string): Instance?`**: Returns the first descendant found with the given Instance.Name.
- **Method `GetActor(): Actor?`**: Returns the Actor associated with the Instance, if any.
- **Method `GetAttribute(attribute: string): Variant`**: Returns the value which has been assigned to the given attribute name.
- **Method `GetAttributeChangedSignal(attribute: string): RBXScriptSignal`**: Returns an event that fires when the given attribute changes.
- **Method `GetAttributes(): Dictionary`**: Returns a dictionary of the instance's attributes.
- **Method `GetChildren(): Instances`**: Returns an array containing all of the instance's children.
- **Method `getChildren(): Instances`**:  *(deprecated)*
- **Method `GetDebugId(scopeLength?: int): string`**: Returns a coded string of the debug ID used internally by Roblox.
- **Method `GetDescendants(): Instances`**: Returns an array containing all of the descendants of the instance.
- **Method `GetFullName(): string`**: Returns a string describing the instance's ancestry.
- **Method `GetStyled(name: string, selector: string?): Variant`**: Returns the styled or explicitly modified value of the specified property,
- **Method `GetStyledPropertyChangedSignal(property: string): RBXScriptSignal`**: Returns an event that fires when the given style property changes on the
- **Method `GetTags(): Array`**: Gets an array of all tags applied to the instance.
- **Method `HasTag(tag: string): boolean`**: Check whether the instance has a given tag.
- **Method `IsAncestorOf(descendant: Instance): boolean`**: Returns true if an Instance is an ancestor of the given
- **Method `IsDescendantOf(ancestor: Instance): boolean`**: Returns `true` if an Instance is a descendant of the given
- **Method `isDescendantOf(ancestor: Instance): boolean`**:  *(deprecated)*
- **Method `IsPropertyModified(property: string): boolean`**: Returns `true` if the value stored in the specified property is not equal
- **Method `QueryDescendants(selector: string): Instances`**: Returns an array containing all descendants of the instance that match the
- **Method `Remove(): ()`**: Sets the object's `Parent` to `nil`, and does the same for all its *(deprecated)*
- **Method `remove(): ()`**:  *(deprecated)*
- **Method `RemoveTag(tag: string): ()`**: Removes a tag from the instance.
- **Method `ResetPropertyToDefault(property: string): ()`**: Resets a property to its default value.
- **Method `SetAttribute(attribute: string, value: Variant): ()`**: Sets the attribute with the given name to the given value.
- **Method `WaitForChild(childName: string, timeOut: double): Instance`**: Returns the child of the Instance with the given name. If the
- **Event `AncestryChanged`**: Fires when the Instance.Parent property of this object or one of
- **Event `AttributeChanged`**: Fires whenever an attribute is changed on the Instance.
- **Event `ChildAdded`**: Fires after an object is parented to this Instance.
- **Event `childAdded`**:  *(deprecated)*
- **Event `ChildRemoved`**: Fires after a child is removed from this Instance.
- **Event `DescendantAdded`**: Fires after a descendant is added to the Instance.
- **Event `DescendantRemoving`**: Fires immediately before a descendant of the Instance is removed.
- **Event `Destroying`**: Fires immediately before (or is deferred until after) the instance is
- **Event `StyledPropertiesChanged`**: Fires whenever any style property is changed on the instance, including

### From [Object](/docs/reference/engine/classes/Object.md)

- **Property `ClassName`** (`string`): A read-only string representing the class this Object belongs to.
- **Property `className`** (`string`):  *(deprecated)*
- **Method `GetPropertyChangedSignal(property: string): RBXScriptSignal`**: Get an event that fires when a given property of the object changes.
- **Method `IsA(className: string): boolean`**: Returns true if an object's class matches or inherits from a given class.
- **Method `isA(className: string): boolean`**:  *(deprecated)*
- **Event `Changed`**: Fires immediately after a property of the object changes, with some