<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/AnimationPlaybackController",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation27AnimationPlaybackControllerC"
  },
  "title" : "AnimationPlaybackController"
}
-->

# AnimationPlaybackController

A controller that manages animation playback.

```
@MainActor @preconcurrency class AnimationPlaybackController
```

## Overview

This class controls the playback of an entity animation by providing its pause, resume, or stop functions.

The animation starts immediately after you call [`playAnimation(_:transitionDuration:startsPaused:)`](/documentation/RealityKit/Entity/playAnimation(_:transitionDuration:startsPaused:)), or `Entity/move(to:relativeTo:duration:timingFunction:)-905k`, which both return an instance of this class.

A controller invalidates after its associated animation completes or stops. To play another animation, perform an action that generates another controller.

While an animation plays, you can receive notification of particular playback states by subscribing to an event. For more information, see [`AnimationEvents`](/documentation/RealityKit/AnimationEvents).

## Topics

### Inspecting and controlling playback

[`func pause()`](/documentation/RealityKit/AnimationPlaybackController/pause())

Pauses the animation.

[`func resume()`](/documentation/RealityKit/AnimationPlaybackController/resume())

Resumes a paused animation.

[`func stop()`](/documentation/RealityKit/AnimationPlaybackController/stop())

Stops an animation.

[`var isPlaying: Bool`](/documentation/RealityKit/AnimationPlaybackController/isPlaying)

A Boolean value that indicates whether the animation plays.

[`var isStopped: Bool`](/documentation/RealityKit/AnimationPlaybackController/isStopped)

A Boolean value that indicates whether the animation stopped.

[`var isValid: Bool`](/documentation/RealityKit/AnimationPlaybackController/isValid)

A Boolean value that indicates whether the animation controller is
functional.

[`var blendFactor: Float`](/documentation/RealityKit/AnimationPlaybackController/blendFactor)

The level of influence the controller gives to its animation.

### Managing completion

[`var isComplete: Bool`](/documentation/RealityKit/AnimationPlaybackController/isComplete)

A Boolean that indicates whether the animation has finished running.

[`var isPaused: Bool`](/documentation/RealityKit/AnimationPlaybackController/isPaused)

A Boolean that indicates whether the animation is paused.

### Accessing the associated entity

[`var entity: Entity?`](/documentation/RealityKit/AnimationPlaybackController/entity)

The entity to which the animation applies.

### Timing animation playback

[`var duration: TimeInterval`](/documentation/RealityKit/AnimationPlaybackController/duration)

The length of time the animation spans, in seconds.

[`var speed: Float`](/documentation/RealityKit/AnimationPlaybackController/speed)

The animation’s rate of playback.

[`var clock: CMClockOrTimebase`](/documentation/RealityKit/AnimationPlaybackController/clock)

A reference clock to synchronize the animation with other events.

[`var time: TimeInterval`](/documentation/RealityKit/AnimationPlaybackController/time)

The animation’s location within the timeline.

### Operators

[`static func == (AnimationPlaybackController, AnimationPlaybackController) -> Bool`](/documentation/RealityKit/AnimationPlaybackController/==(_:_:))

Indicates whether two animation playback controllers are equal.

### Instance Methods

[`func hash(into: inout Hasher)`](/documentation/RealityKit/AnimationPlaybackController/hash(into:))

Hashes the essential components of the controller by feeding them into
the given hash function.

[`func stop(blendOutDuration: TimeInterval)`](/documentation/RealityKit/AnimationPlaybackController/stop(blendOutDuration:))

Stops an animation with a fade-out time.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Escapable`](/documentation/Swift/Escapable)

[`Sendable`](/documentation/Swift/Sendable)

[`Copyable`](/documentation/Swift/Copyable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Observable`](/documentation/Observation/Observable)

[`Equatable`](/documentation/Swift/Equatable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)