Skip to content

XR Origin

Updated

How the player rig sits on the spawn point; recenter support.

Type
comp-xr-origin
Script class
XROriginComponent
Per entity
One
Version
2.0.0

Read about it in XR Origin: 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
floorOffset -10000 ≤ x ≤ 10000
worldScale 0.001 ≤ x ≤ 1000

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

  • XROrigin::recenter
  • XROrigin::reset

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