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.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
states[]. |
0 ≤ x ≤ 3600 |
|
states[]. |
1 ≤ x ≤ 1000000, integer |
|
states[]. |
0 ≤ x ≤ 86400 |
|
states[]. |
0 ≤ x ≤ 3600 |
|
states[]. |
1 ≤ x ≤ 1000000, integer |
|
states[]. |
0 ≤ x ≤ 86400 |
|
states[].x |
||
states[].y |
||
transitions[]. |
0 ≤ x ≤ 86400 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
AnimationGraph::state-change
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 door graph in codeA door with an open timeline layer gets a two-state Animation Graph from a Behavior script, and one shared signal from a button opens and closes it.
Press Toggle door to open the door, and again to close it. 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(AnimationGraphComponent); if (component) log(component.props);}