Handle
Updated
Drag the entity to move, rotate or scale it within limits.
- Type
comp-handle- Script class
HandleComponent- Per entity
- One
- Version
- 1.0.0
Read about it in Handles: 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 |
|---|---|---|
rotate |
||
translate |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
Handle::startHandle::endHandle::hoverHandle::leave
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Lock the door once a puzzle is solvedWhen the puzzle is solved, a script snaps a door shut and locks every axis of its Handle; resetting the puzzle restores the Handle's props.
Drag the door to swing it, then press Solve puzzle: it snaps shut and no longer moves. Press Reset puzzle to unlock it. Scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(HandleComponent); if (component) log(component.props);}