Skip to main content

<box>

Renders a box. When placed inside a <rigidbody> it gains physical properties.

Props

PropTypeDescriptionDefault
sizeNumber|ArraySize of the box. Use an array to control width, height, depth separately.1
colorStringColor of the box.0xededed
opacityNumberOpacity of the box.1
positionArrayPosition of the box.[0,0,0]
rotationArrayRotation of the box.[0,0,0]
scaleNumber|ArrayScale of the box. A single value will be used scalar.1
onHoverEnterFunctionCalled when an avatar hovers over the box. Provides an Event
onHoverLeaveFunctionCalled when an avatar hovers out of the box. Provides an Event
onPointerDownFunctionCalled when avatar presses the pointer down over this object.
onPointerDownHintStringText displayed when hovering over this object when onPointerDown is defined.
onPointerUpFunctionCalled when avatar releases the pointer over this object.
onPointerUpHintStringText displayed when hovering over this object with the pointer down and onPointerUp is defined.
hitDistanceNumberMaximum distance to interact with this node.3
hiddenBooleanWhether to hide the box. Useful for invisible walls etc.false
climbableBooleanWhether avatars can climb the box when placed inside a <rigidbody>

Ref

FieldDescription
getPosition(vec3)Get position
setPosition(vec3)Update position
getPosition(eul)Get rotation
setRotation(eul)Update rotation

Notes

None.