Skip to content

Animation Graph

Updated

State machine that switches animations on signals.

Type
comp-animation-graph
Script class
AnimationGraphComponent
Per entity
One
Version
1.0.0

Read about it in Animation Graph: 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
states[].enter[].fade 0 ≤ x ≤ 3600
states[].enter[].repeatCount 1 ≤ x ≤ 1000000, integer
states[].enter[].time 0 ≤ x ≤ 86400
states[].exit[].fade 0 ≤ x ≤ 3600
states[].exit[].repeatCount 1 ≤ x ≤ 1000000, integer
states[].exit[].time 0 ≤ x ≤ 86400
states[].x
states[].y
transitions[].delay 0 ≤ x ≤ 86400

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

  • AnimationGraph::state-change

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(AnimationGraphComponent);
if (component) log(component.props);
}