<!--
{
  "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/ActionEvent/animationState",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation11ActionEventV14animationStateAA09AnimationF8Protocol_pSgvp"
  },
  "title" : "animationState"
}
-->

# animationState

The animation state for the action.

```
var animationState: (any AnimationStateProtocol)? { get }
```

## Discussion

Used to procedurally animate a target value with cross-fading, and additive blending support.

The animation state is available when a bind target along with its type is defined for the action.
(See [`AnimationStateProtocol`](/documentation/RealityKit/AnimationStateProtocol))

The following example returns an animated value to the animation system
for the current frame by storing its value within the returned animation state.

```swift
MyCustomAction.subscribe(.updated) { event in
    // The returned state will be nil
    // if the action animation's bind target, and type is not defined.
    guard let animationState = event.animationState else {
       return
    }
    animationState.storeAnimatedValue(myAnimatedResult)
}
```

---

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)