<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/Entity/playAnimation(_:transitionDuration:blendLayerOffset:separateAnimatedValue:startsPaused:clock:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation6EntityC13playAnimation_18transitionDuration16blendLayerOffset21separateAnimatedValue12startsPaused5clockAA0E18PlaybackControllerCAA0E8ResourceC_SdSiS2byXlSgtF"
  },
  "title" : "playAnimation(_:transitionDuration:blendLayerOffset:separateAnimatedValue:startsPaused:clock:)"
}
-->

# playAnimation(_:transitionDuration:blendLayerOffset:separateAnimatedValue:startsPaused:clock:)

Plays an animation with the specified options.

```
@discardableResult @MainActor @preconcurrency func playAnimation(_ animation: AnimationResource, transitionDuration: TimeInterval = 0, blendLayerOffset: Int = 0, separateAnimatedValue: Bool = false, startsPaused: Bool = false, clock: CMClockOrTimebase? = nil) -> AnimationPlaybackController
```

## Parameters

`animation`

The animation to play.

`transitionDuration`

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

`blendLayerOffset`

An integer that specifies the order in which to
apply animations when more than one animation is playing. Valid values
are `0` or `1`.

`separateAnimatedValue`

When set to false, this value indicates that the
animation will write directly to the entity’s base value. When set to true,
this value indicates that the animation will write to an interim value for
the duration of the animation. If this value is set to true then when the
animation completes, the entity’s value will be reset to the base value.

`startsPaused`

A Boolean that pauses the progress of an animation when
set to `true`.

`clock`

An optional clock to drive the animation with a custom
timescale.

## Discussion

Call this method to play an animation and configure playback options.
RealityKit supports blending up to two different animations at the same
time. When RealityKit applies multiple animations to an entity, the
order in which it applies the animations affects the final animation.
Use the `blendLayerOffset` parameter to specify the order of animations
when playing multiple animations at the same time.

---

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)