Gltf
Updated
Loads a glTF/GLB model.
- Type
comp-gltf- Script class
GLTFComponent- Per entity
- One
- Version
- 1.0.0
Read about it in Models and meshes: what it does, how to use it from a script, and examples.
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
GLTF::readyGLTF::error
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Sway a headA script turns a character's Head bone with a sine wave every frame, through its Skeleton component.
Watch the head sway from side to side. 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(GLTFComponent); if (component) log(component.props);}