Instance Method

playAnimation(_:transitionDuration:startsPaused:)

Plays the given animation on the entity.

Declaration

@discardableResult func playAnimation(_ animation: AnimationResource, transitionDuration: TimeInterval = 0, startsPaused: Bool = false) -> 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

Playing Animation

var availableAnimations: [AnimationResource]

The list of animations associated with the entity.

func stopAllAnimations(recursive: Bool)

Stops all playing of animations on this entity.