Contents

playAnimation(_:transitionDuration:startsPaused:)

Plays the given animation on the entity.

Declaration

@discardableResult @MainActor @preconcurrency func playAnimation(_ animation: AnimationResource, transitionDuration: TimeInterval, startsPaused: Bool) -> AnimationPlaybackController

Parameters

  • animation:

    The animation to play.

  • transitionDuration:

    The duration in seconds over which the animation fades in or cross-fades.

  • startsPaused:

    A Boolean that you set to true to return from the call with the animation paused. Set to false to start the animation right away.

Return Value

An animation playback controller that you can use to start and stop the animation.

See Also

Animating an entity