<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/AnimationEvents",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation15AnimationEventsO"
  },
  "title" : "AnimationEvents"
}
-->

# AnimationEvents

Notable milestones that the framework signals during animation playback.

```
enum AnimationEvents
```

## Overview

This enumeration defines the playback states that an animated entity can
indicate to an app. To receive notification of a particular event, create a
completion handler:

```swift
private func onAnimationCompleted(_ event:
    AnimationEvents.PlaybackCompleted) {
        // Define code that runs when the animation completes.
}
```

Then, subscribe the handler on the entity for the state of interest:

```swift
// Get an animation.
let animationName =
entity.availableAnimations.first!.name!

// Pass the animation to an entity and get a controller.
entity.playAnimation(named: animationName, transitionDuration: 0.0)

entitySubscription = view.scene.publisher(for:
    AnimationEvents.PlaybackCompleted.self, on: entity)
        .sink(receiveValue: onAnimationCompleted)
```

## Topics

### Recognizing animation events

[`AnimationEvents.PlaybackStarted`](/documentation/RealityKit/AnimationEvents/PlaybackStarted)

The event raised when an animation has been started.

[`AnimationEvents.PlaybackCompleted`](/documentation/RealityKit/AnimationEvents/PlaybackCompleted)

The event raised when an animation reaches the end of its duration.

[`AnimationEvents.PlaybackLooped`](/documentation/RealityKit/AnimationEvents/PlaybackLooped)

The event raised when an animation loops.

[`AnimationEvents.PlaybackTerminated`](/documentation/RealityKit/AnimationEvents/PlaybackTerminated)

The event raised when an animation has been terminated, regardless of
whether it ran to completion.

### Recognizing skeletal events

[`AnimationEvents.SkeletalPoseUpdateComplete`](/documentation/RealityKit/AnimationEvents/SkeletalPoseUpdateComplete)

Raised immediately after the SkeletalPoseSystem has been updated.

### Recognizing root motion events

[`AnimationEvents.RootMotionDidUpdate`](/documentation/RealityKit/AnimationEvents/RootMotionDidUpdate)

The event raised each frame when a new root motion delta is produced for an entity.



---

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)