Obj
Updated
Loads a Wavefront OBJ model.
- Type
comp-obj- Script class
OBJComponent- 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.
OBJ::readyOBJ::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
Load an OBJ modelA low-poly tree loaded from a Wavefront OBJ (.obj) file, which carries geometry only, so an amber Standard material colours it. The script centres it and scales it to 1.6 m.
Watch the tree turn on the turntable. 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(OBJComponent); if (component) log(component.props);}