Lottie
Updated
A Lottie vector animation surface.
- Type
comp-lottie- Script class
LottieComponent- Per entity
- One
- Version
- 1.2.0
Read about it in Images: 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 |
|---|---|---|
grayscale |
0 ≤ x ≤ 1 |
|
height |
0 ≤ x ≤ 10000 |
|
maxFps |
1 ≤ x ≤ 60 |
|
opacity |
0 ≤ x ≤ 1 |
|
quality |
0. |
|
speed |
0 < x ≤ 16 |
|
width |
0 ≤ x ≤ 10000 |
|
zoom |
0. |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
Lottie::readyLottie::errorLottie::playLottie::pauseLottie::end
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Confetti when a goal is reachedPress the goal button and a Lottie confetti burst appears, plays once and hides itself: a Lottie entity saved disabled, played by a script when another script emits goal/reached.
Click the amber button to reach the goal. Click again for another burst. 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(LottieComponent); if (component) log(component.props);}