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

# AnimationDefinition

The configuration, including target object, timeframe, and visual semantics,
of an animation.

```
protocol AnimationDefinition
```

## Overview

The framework adopts this protocol for several concrete animation objects,
such as [`FromToByAnimation`](/documentation/RealityKit/FromToByAnimation), [`SampledAnimation`](/documentation/RealityKit/SampledAnimation), [`OrbitAnimation`](/documentation/RealityKit/OrbitAnimation),
[`BlendTreeAnimation`](/documentation/RealityKit/BlendTreeAnimation), [`AnimationView`](/documentation/RealityKit/AnimationView), and [`AnimationGroup`](/documentation/RealityKit/AnimationGroup).

## Topics

### Configuring the animation

[`var name: String`](/documentation/RealityKit/AnimationDefinition/name)

A textual name for the animation.

[`var bindTarget: BindTarget`](/documentation/RealityKit/AnimationDefinition/bindTarget)

A textual name that identifies the particular property that animates.

[`var blendLayer: Int32`](/documentation/RealityKit/AnimationDefinition/blendLayer)

The order in which the framework composites the animation.

### Timing the animation

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

A factor that increases or decreases the animation’s rate of playback.

[`var delay: TimeInterval`](/documentation/RealityKit/AnimationDefinition/delay)

An amount of time that elapses before the animation plays.

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

The total playback time of the animation.

[`var offset: TimeInterval`](/documentation/RealityKit/AnimationDefinition/offset)

The time, in seconds, at which the animation begins within the duration.

[`var trimDuration: TimeInterval?`](/documentation/RealityKit/AnimationDefinition/trimDuration)

An optional duration that overrides the source animation’s duration.

[`var trimStart: TimeInterval?`](/documentation/RealityKit/AnimationDefinition/trimStart)

The time, in seconds, at which the animation plays.

[`var trimEnd: TimeInterval?`](/documentation/RealityKit/AnimationDefinition/trimEnd)

The time, in seconds, at which the source animation stops.

[`func trimmed(start: TimeInterval?, end: TimeInterval?, duration: TimeInterval?) -> Self`](/documentation/RealityKit/AnimationDefinition/trimmed(start:end:duration:))

Edits the animation duration according to the specified time.

### Repeating animation playback

[`var repeatMode: AnimationRepeatMode`](/documentation/RealityKit/AnimationDefinition/repeatMode)

An option that determines how the animation repeats.

[`var fillMode: AnimationFillMode`](/documentation/RealityKit/AnimationDefinition/fillMode)

An option that determines which data displays outside of the normal
duration.

[`func repeated(count: TimeInterval) -> Self`](/documentation/RealityKit/AnimationDefinition/repeated(count:)-937w)

Repeats an animation the number of times specified by an irrational
number.

[`func repeated(count: Int) -> Self`](/documentation/RealityKit/AnimationDefinition/repeated(count:)-941x8)

Repeats an animation the number of times specified by a whole number.

[`func repeatingForever() -> Self`](/documentation/RealityKit/AnimationDefinition/repeatingForever())

Repeats the animation infinitely.

### Instance Methods

[`func repeated(count:)`](/documentation/RealityKit/AnimationDefinition/repeated(count:))

Repeats an animation the number of times specified by a whole number.

## Relationships

### Conforming Types

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

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

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

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

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

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

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

---

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)