Skip to content

Documentation / scene / PlayAnimationOptions

Type Alias: PlayAnimationOptions

PlayAnimationOptions = object

Defined in: libs/scene/src/animation/animationset.ts:77

Options for playing an animation.

Controls looping, playback speed (including reverse), and fade-in blending.

Properties

repeat?

optional repeat?: number

Defined in: libs/scene/src/animation/animationset.ts:84

Number of loops to play.

  • 0: infinite looping (default).
  • n > 0: play exactly n loops (each loop is one full duration of the clip).

speedRatio?

optional speedRatio?: number

Defined in: libs/scene/src/animation/animationset.ts:92

Playback speed multiplier.

  • 1: normal speed (default).
  • >1: faster; <1: slower.
  • Negative values play the clip in reverse. The initial currentTime will be set to the end.

fadeIn?

optional fadeIn?: number

Defined in: libs/scene/src/animation/animationset.ts:100

Fade-in duration in seconds.

Interpolates the animation weight from 0 to the clip's configured weight over this time. Use together with stopAnimation(..., { fadeOut }) for smooth cross-fading. Default is 0 (no fade-in).


completionFadeOut?

optional completionFadeOut?: number

Defined in: libs/scene/src/animation/animationset.ts:108

Fade-out duration in seconds used after the playback completes naturally.

When greater than 0, the playback emits complete at the authored end time but remains active for this duration while its weight fades to 0. This lets a following playback cross-fade from the completed pose instead of snapping after the completed clip is removed.


weight?

optional weight?: number

Defined in: libs/scene/src/animation/animationset.ts:115

Weight of the animation clip.

Used during blending when multiple animations affect the same property. Default is the clip's configured weight.


id?

optional id?: string

Defined in: libs/scene/src/animation/animationset.ts:119

Optional stable playback id. Useful for blueprint/editor references.


layer?

optional layer?: string

Defined in: libs/scene/src/animation/animationset.ts:123

Logical layer/channel name used by higher-level controllers.


priority?

optional priority?: number

Defined in: libs/scene/src/animation/animationset.ts:127

Priority used by higher-level interrupt policies.


interruptible?

optional interruptible?: boolean

Defined in: libs/scene/src/animation/animationset.ts:131

Whether higher-level controllers may interrupt this playback.


range?

optional range?: object

Defined in: libs/scene/src/animation/animationset.ts:135

Optional sub-range to play.

start?

optional start?: AnimationTimeRef

end?

optional end?: AnimationTimeRef


sync?

optional sync?: AnimationPlaybackSyncOptions

Defined in: libs/scene/src/animation/animationset.ts:146

Optional phase synchronization source used to choose the initial playback time.

When omitted, playback starts at the range start (or clip start), and reverse playback starts at the range end (or clip end). When set, the new playback starts at the phase copied from the referenced active playback.

Released under the MIT License.