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.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
layers[]. |
||
layers[]. |
0 ≤ x ≤ 86400 |
|
layers[]. |
0 ≤ x ≤ 1000 |
|
speed |
0 ≤ x ≤ 100 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
AnimationTimeline::playAnimationTimeline::stopAnimationTimeline::repeatAnimationTimeline::finishedAnimationTimeline::signal
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Build a timeline from codeA gem hovers up and down and spins for ever on an Animation Timeline that a Behavior script builds in code, with a smooth pingpong layer and a linear repeating one.
Watch the gem hover and spin. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(AnimationTimelineComponent); if (component) log(component.props);}