Back to Aframe

hand-tracking-grab-controls

docs/components/hand-tracking-grab-controls.md

1.7.11.3 KB
Original Source

Grab any entity with hand tracking using the pinch gesture.

Example

html
<a-entity id="leftHand" hand-tracking-grab-controls="hand: left;"></a-entity>
<a-entity id="rightHand" hand-tracking-grab-controls="hand: right;"></a-entity>

The grabbable component makes any entity hand grababble.

html
<a-box grabbable></a-box>

For debugging purposes you can make the colliders visible, changing color when a collision is detected, as shown below:

html
<a-scene obb-collider="showColliders: true"></a-scene>

Properties

PropertyDescriptionDefault Value
handThe hand that will be tracked (i.e., right, left).left
colorThe color of the hand model.white
hoverColorHand color when hand intersects a grabbable entity bounding box.#538df1
hoverEnabledIf the hand model changes color when intersecting a grabbable entity.false