Class

AnimationPlaybackController

A controller that manages animation playback.

Declaration

class AnimationPlaybackController

Overview

You receive an animation playback controller when you start an animation, for example, when you call the move(to:relativeTo:duration:timingFunction:) or the playAnimation(_:transitionDuration:startsPaused:) method.

After the animation completes, or if you call the stop() method, the animation controller becomes invalid and can’t be used again.

Look for one of the events in AnimationEvents if you want to be alerted when certain aspects of animation occur.

Topics

Starting and Stopping Animation

func pause()

Pauses the animation.

func resume()

Resumes a paused animation.

func stop()

Stops an animation.

Handling Completion

var isComplete: Bool

A Boolean that indicates whether the animation has finished running.

var isPaused: Bool

A Boolean that indicates whether the animation is paused.

Finding the Associated Entity

var entity: Entity?

The entity to which the animation applies.

Comparing Animation Playback Controllers

static func == (AnimationPlaybackController, AnimationPlaybackController) -> Bool

Indicates whether two animation playback controllers are equal.

static func != (AnimationPlaybackController, AnimationPlaybackController) -> Bool

Indicates whether two animation playback controllers are not equal.

func hash(into: inout Hasher)

Hashes the essential components of the controller by feeding them into the given hash function.

var hashValue: Int

The hashed value of the controller.

Relationships

Conforms To

See Also

Animation Playback

class AnimationResource

An animation that can be played by an entity.

struct AnimationTimingFunction

The pacing of an animation transition.

enum AnimationEvents

Events triggered by the RealityKit animation system.