---
title: AnimationEvents
framework: realitykit
role: symbol
role_heading: Enumeration
path: realitykit/animationevents
---

# AnimationEvents

Notable milestones that the framework signals during animation playback.

## Declaration

```swift
enum AnimationEvents
```

## Overview

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: 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: // 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](realitykit/animationevents/playbackstarted.md)
- [AnimationEvents.PlaybackCompleted](realitykit/animationevents/playbackcompleted.md)
- [AnimationEvents.PlaybackLooped](realitykit/animationevents/playbacklooped.md)
- [AnimationEvents.PlaybackTerminated](realitykit/animationevents/playbackterminated.md)

### Recognizing skeletal events

- [AnimationEvents.SkeletalPoseUpdateComplete](realitykit/animationevents/skeletalposeupdatecomplete.md)

### Recognizing root motion events

- [AnimationEvents.RootMotionDidUpdate](realitykit/animationevents/rootmotiondidupdate.md)

## See Also

### Physics and motion events

- [CollisionEvents](realitykit/collisionevents.md)
- [PhysicsSimulationEvents](realitykit/physicssimulationevents.md)
