Microtube Docs
EN中文
Developers / Godot / Scene setup

Godot scene setup

Put the HEXR rig in your XR scene, see your hands, and connect the gloves.

What a HEXR scene needs

NodeWhat it doesAdded by
XROrigin3D + XRCamera3DYour XR scene. Hands are tracked relative to the originYou, or Create HexR Rig
HexRRigUnity’s HexR Main. Under the origin: a HexRTrackedHand per hand, which puts a HapticFingerTrigger on the five fingertips and the palm, and a PressureTrackerMain per hand, which every haptic goes through. It starts XR tooHexR → Create HexR Rig
HexRFloatingMenuThe floating menu, as in Unity: connect the gloves, show the colliders, a live readout of each finger, switch scenesHexR → Add HexR Menu
HexRRemote (optional)Lets the HexR Companion app watch and control the headsetHexR → Add HexR Remote

The gloves themselves belong to the HexR autoload, so they stay connected across scene changes. Each scene brings its own rig.

Build a scene

  1. Create the rig

    With your 3D scene open, HexR → Create HexR Rig. It adds an XROrigin3D with a camera if there is none.

  2. Add the menu

    HexR → Add HexR Menu places it ahead of you and to the left, facing you, as Unity does. It stays with you across scene changes; pinch its header to move it.

  3. List your scenes

    Project Settings → HexR → Scenes (Unity: Build Settings). The menu’s Scenes section, HexR Remote and SceneLoader.load_scene() switch between them.

  4. Check

    HexR → Troubleshoot → Validate Scene Setup.

XR starts by itself: HexRRig turns OpenXR on when the headset runtime is there (its Start XR option), and works alongside Godot XR Tools’ StartXR. For a scene with all of it at once, use HexR → Create Demo Scene.

Seeing your hands

HEXR reads the OpenXR hand tracker directly, so the touch points work with or without a hand mesh. To see your hands, put a hand model under an XRNode3D tracking /user/hand_tracker/left (or right) and give its skeleton an XRHandModifier3D. The tutorial’s scripts/hand_visual.gd does exactly that with the hand models from Godot’s demo projects.

Connect the gloves

Switch the glove on, then poke Connect Left Glove (or Right) on the floating menu. Don’t pair it in the headset’s Bluetooth settings. The first time, the headset asks for Nearby devices (Quest) or Location (PICO). From code:

gdscript
# Anywhere in your game: the HexR autoload owns both gloves.
func _ready() -> void:
    HexR.glove_connected.connect(func(hand): print(HexRTypes.hand_name(hand), " connected"))
    HexR.glove_disconnected.connect(func(hand): print(HexRTypes.hand_name(hand), " disconnected"))
    # Asks for the Bluetooth permission first where the headset needs it.
    # Does nothing for a glove that is already connected or connecting.
    HexR.connect_hand(HaptGloveHandler.HandType.LEFT)    # Unity: HexRManager.Instance.Connect(...)
    HexR.connect_hand(HaptGloveHandler.HandType.RIGHT)

A glove that drops reconnects by itself, retrying after 1, 2, 4 and 8 seconds for up to a minute. It is released before it disconnects, and when the app is paused or quits.

Put the app on the headset

Plug the headset in and press Godot’s Remote Deploy button, or export the APK and install it with adb install. While it runs, HexR Tools’ Haptics Tester set to Running game drives its gloves from the editor, through the debugger.

Next

Make things felt: Haptics setup.