<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ActionAnimation/init(for:events:name:bindTarget:blendLayer:repeatMode:fillMode:trimStart:trimEnd:trimDuration:offset:delay:speed:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation15ActionAnimationV3for6events4name10bindTarget10blendLayer10repeatMode04fillM09trimStart0O3End0O8Duration6offset5delay5speedACyxGx_SayAA0C15EventDefinitionVyxGGSSAA04BindI0OSgs5Int32VAA0d6RepeatM0OAA0d4FillM0VSdSgA3_A3_S2dSftcfc"
  },
  "title" : "init(for:events:name:bindTarget:blendLayer:repeatMode:fillMode:trimStart:trimEnd:trimDuration:offset:delay:speed:)"
}
-->

# init(for:events:name:bindTarget:blendLayer:repeatMode:fillMode:trimStart:trimEnd:trimDuration:offset:delay:speed:)

Constructs an action animation that generates events at user defined times.

```
init(for action: ActionType, events: [ActionAnimation<ActionType>.EventDefinitionType], name: String = "", bindTarget: BindTarget? = nil, blendLayer: Int32 = 0, repeatMode: AnimationRepeatMode = .none, fillMode: AnimationFillMode = [], trimStart: TimeInterval? = nil, trimEnd: TimeInterval? = nil, trimDuration: TimeInterval? = nil, offset: TimeInterval = 0, delay: TimeInterval = 0, speed: Float = 1.0)
```

## Parameters

`action`

The user action.

`events`

An array of event definitions defining when each action event occurs.

`name`

The name of the animation.

`bindTarget`

A textual name that identifies the particular property
that animates.

`blendLayer`

The order in which the framework composites the animation
into the view.

`repeatMode`

An option that determines how the animation repeats.

`fillMode`

The playback behavior outside of the normal duration.

`trimStart`

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

`trimEnd`

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

`trimDuration`

An optional duration that overrides the calculated duration.

`offset`

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

`delay`

An amount of time that lapses before the animation plays.

`speed`

A factor that changes the animation’s rate of playback.

---

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)