Skip to content

Animation Timeline

Updated

Keyframe animation of the entity’s props, in layers.

Type
comp-animation-timeline
Script class
AnimationTimelineComponent
Per entity
One
Version
1.0.0

Read about it in Animation Timeline: what it does, how to use it from a script, and examples.

The props the runtime declares for this component, with their defaults and accepted ranges.

Prop Default Range
layers[].duration
layers[].tracks[].keys[].time 0 ≤ x ≤ 86400
layers[].weight 0 ≤ x ≤ 1000
speed 0 ≤ x ≤ 100

Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.

  • AnimationTimeline::play
  • AnimationTimeline::stop
  • AnimationTimeline::repeat
  • AnimationTimeline::finished
  • AnimationTimeline::signal

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(AnimationTimelineComponent);
if (component) log(component.props);
}