Animation Clip
Updated
Plays the animation clips built into a model.
- Type
comp-animation-clip- Script class
AnimationClipComponent- Per entity
- One
- Version
- 1.0.0
Read about it in Animation Clip: 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 |
|---|---|---|
speed |
- |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
AnimationClip::readyAnimationClip::repeatAnimationClip::finished
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Walk while a key is heldYour first animation: a character idles, blends into its Walk clip while W is held and back to Idle when it is released, with an Animation Clip and its layers.
Click the view so it has the keyboard focus, then hold W to walk and release it to stop.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(AnimationClipComponent); if (component) log(component.props);}