<!--
{
  "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/Entity/playAnimation(_:transitionDuration:startsPaused:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation6EntityC13playAnimation_18transitionDuration12startsPausedAA0E18PlaybackControllerCAA0E8ResourceC_SdSbtF"
  },
  "title" : "playAnimation(_:transitionDuration:startsPaused:)"
}
-->

# playAnimation(_:transitionDuration:startsPaused:)

Plays the given animation on the entity.

```
@discardableResult @MainActor @preconcurrency func playAnimation(_ animation: AnimationResource, transitionDuration: TimeInterval, startsPaused: Bool) -> AnimationPlaybackController
```

## Parameters

`animation`

The animation to play.

`transitionDuration`

The duration in seconds over which the animation
fades in or cross-fades.

`startsPaused`

A Boolean that you set to `true` to return from the call
with the animation paused. Set to `false` to start the animation right away.

## Return Value

An animation playback controller that you can use to start
and stop the animation.

---

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)