<!--
{
  "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/AnimationResource",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation17AnimationResourceC"
  },
  "title" : "AnimationResource"
}
-->

# AnimationResource

An animation for the properties of scenes or entities.

```
@MainActor @preconcurrency class AnimationResource
```

## Overview

You find animation resources in an entity’s [`availableAnimations`](/documentation/RealityKit/Entity/availableAnimations) array.
Animation resources come bundled with an entity when you load the
entity from a file. They describe an animation that’s specific to the entity
to which they are attached.

Use the entity’s [`playAnimation(_:transitionDuration:startsPaused:)`](/documentation/RealityKit/Entity/playAnimation(_:transitionDuration:startsPaused:))
method to play a particular item in its animation resource array, or the
`playAnimation(named:transitionDuration:startsPaused:)` method to play all
of the animations with a given name. From both methods, you receive an
[`AnimationPlaybackController`](/documentation/RealityKit/AnimationPlaybackController) instance that lets you manage playback of
the resource.

If you want to loop an animation, call the resource’s
[`repeat(count:)`](/documentation/RealityKit/AnimationResource/repeat(count:)) method to create a new resource that
plays a given number of times in a row, or call the
[`repeat(duration:)`](/documentation/RealityKit/AnimationResource/repeat(duration:)) method to create a new resource that
loops for the given duration. The latter loops indefinitely if you omit the
duration parameter. You use the new animation resource that these methods
return just as you would any other.

## Topics

### Creating an animation resource

[`generate(with:)`](/documentation/RealityKit/AnimationResource/generate(with:))

Creates an animation resource from a definition.

[`sequence(with:)`](/documentation/RealityKit/AnimationResource/sequence(with:))

Creates an animation resource that plays a collection of animations in a
specified sequence.

[`group(with:)`](/documentation/RealityKit/AnimationResource/group(with:))

Creates an animation resource that simultaneously plays back a
collection of animations.

[`repeat(count:)`](/documentation/RealityKit/AnimationResource/repeat(count:))

Creates an animation that repeats the specified number of times.

[`repeat(duration:)`](/documentation/RealityKit/AnimationResource/repeat(duration:))

Repeats an animation for the specified amount of time.

### Inspecting animation information

[`name`](/documentation/RealityKit/AnimationResource/name)

The name of the animation resource.

[`definition`](/documentation/RealityKit/AnimationResource/definition)

The timeframe, target object, and visual semantics of the animation.

[`AnimationFillMode`](/documentation/RealityKit/AnimationFillMode)

Options that determine which animation frames display outside of the normal
duration.

### Associating an animation with an entity

[`store(in:)`](/documentation/RealityKit/AnimationResource/store(in:))

Adds the animation to an entity without playing it.



---

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)