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

# AnimationGroup

A collection of animations that play simultaneously.

```
struct AnimationGroup
```

## Overview

This structure concurrently starts the animations it contains. Use a group
to:

- Animate more than one property at once.
- Animate the same property at different times.

### Animate multiple properties concurrently

For each animatable property your animation needs to control, create a group
and add an animation to the array argument of the initializer. The following
listing begins coding an animation group that colorizes 3D numbers that
count down over a 4-second duration.

```swift
let frames: [Float] = [3.0, 2.0, 1.0, 0.0]
let duration = TimeInterval(frames.count)
let anim1 = FromToByAnimation<Float>(name: "colorize", from: 0.0, to: 1.0,
    duration: duration, bindTarget: .parameter("foo"))
let anim2 = SampledAnimation<Float>(frames: frames, name: "count down",
    frameInterval: duration / frames.count, bindTarget: .parameter("bar"))
let group = AnimationGroup(group: [anim1, anim2], name: "group")
```

### Create a sequence for the same animation

You can play the same animation at different times by grouping multiple
[`AnimationDefinition`](/documentation/RealityKit/AnimationDefinition) objects that refer to the same animated property. To
disperse their playback at runtime, give each definition a unique
[`delay`](/documentation/RealityKit/AnimationDefinition/delay).

> Important: The framework processes animations with a lower
> ``doc://com.apple.RealityKit/documentation/RealityKit/AnimationGroup/blendLayer`` first, and if the
> ``doc://com.apple.RealityKit/documentation/RealityKit/AnimationGroup/blendLayer`` matches, in the order in which they appear in
> the groups array. If two animations on the same property overlap durations
> at runtime, the one that the framework processes second overwrites the
> first.

## Topics

### Creating an animation group

[`init(group: [any AnimationDefinition], name: String, repeatMode: AnimationRepeatMode, fillMode: AnimationFillMode, trimStart: TimeInterval?, trimEnd: TimeInterval?, trimDuration: TimeInterval?, offset: TimeInterval, delay: TimeInterval, speed: Float)`](/documentation/RealityKit/AnimationGroup/init(group:name:repeatMode:fillMode:trimStart:trimEnd:trimDuration:offset:delay:speed:))

Creates a collection of animations that play simultaneously.

### Configuring the group

[`var group: [any AnimationDefinition]`](/documentation/RealityKit/AnimationGroup/group)

A collection of animations to run.

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

A textual name for the group.

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

A textual name that refers to a property on which to run the grouped
animations.

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

The order in which the framework composites the animation.

[`var additive: Bool`](/documentation/RealityKit/AnimationGroup/additive)

A Boolean value that indicates whether the animation builds on the
current state of the target entity or resets the state before running.

[`var group: [any AnimationDefinition]`](/documentation/RealityKit/AnimationGroup/group)

A collection of animations to run.

### Timing the group

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

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

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

An amount of time that lapses before the animation plays.

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

The total playback time of the animation.

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

The time, in seconds, at which the animations begin within the duration.

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

An optional duration that overrides the calculated duration.

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

The time, in seconds, at which the animations play.

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

The time, in seconds, at which the animations stop.

### Repeating group playback

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

An option that determines how the animations repeat.

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

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

## Relationships

### Conforms To

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

---

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)