<!--
{
  "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/AnimationResource/makeActionAnimation(for:duration:name:bindTarget:blendLayer:repeatMode:fillMode:trimStart:trimEnd:trimDuration:offset:delay:speed:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation17AnimationResourceC010makeActionC03for8duration4name10bindTarget10blendLayer10repeatMode04fillO09trimStart0Q3End0Q8Duration6offset5delay5speedACx_SdSSAA04BindK0OSgs5Int32VAA0c6RepeatO0OAA0c4FillO0VSdSgA_A_S2dSftKAA06EntityF0RzlFZ"
  },
  "title" : "makeActionAnimation(for:duration:name:bindTarget:blendLayer:repeatMode:fillMode:trimStart:trimEnd:trimDuration:offset:delay:speed:)"
}
-->

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

Creates an action animation containing a single event definition from an action.

```
@MainActor @preconcurrency static func makeActionAnimation<T>(for action: T, duration: TimeInterval = 1.0, 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) throws -> AnimationResource where T : EntityAction
```

## Parameters

`action`

The user action.

`duration`

The event interval’s duration.

`name`

A textual name for the animation.

`bindTarget`

A textual name that identifies the particular property that animates.

`blendLayer`

An integer that specifies the order in which to apply animations when more than one animation is playing.

`repeatMode`

An option that determines how the animation repeats.

`fillMode`

An option that determines how the animation repeats.

`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.

## Return Value

An animation resource to play the given action.

## Discussion> Note: Duration is clamped to a positive, small non zero value, if duration is zero or less.

---

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)