Pivotable
Updated
Adds an interactive move/rotate/scale gizmo to the entity.
- Type
comp-pivotable- Script class
PivotableComponent- Per entity
- One
- Version
- 1.1.0
Read about it in Selection and grabbing: 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 |
|---|---|---|
size |
0.2 ≤ x ≤ 10 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
Pivotable::startPivotable::endPivotable::hoverPivotable::leave
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Click the chair to show its Pivotable gizmo and drag the arrows or rings to move it; T, R and S switch between moving on the floor, turning and scaling, and L between local and world axes.
Click the chair, drag its gizmo, then press T, R, S or L to change what the gizmo does. The arrow keys and WASD do not move the camera here. Drag the background to orbit, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(PivotableComponent); if (component) log(component.props);}