Microtube Docs
Developers / Guides / Triggering feedback

Triggering feedback

How to fire haptic feedback at the right moment, and the model behind it.

Haptics triggers

Haptics fire in one of two ways: from events you raise in code — a touch, a grasp, a release — or from physics-based colliders in your scene that trigger feedback on contact. Gate feedback behind these triggers rather than polling every frame.

Warning

Don't send feedback in a tight loop. Calls to a disconnected glove are ignored, but flooding the driver every frame can cause lag. Gate feedback behind your interaction events.

Per-finger pressure

You address feedback per finger, each with an intensity. In Python, build a payload for several fingers at once and write it to the glove:

python
F = Haptics.Finger   # fingers are enum members, not strings

data = haptics.hexr_pressure_multiple(
    [F.Thumb, F.Index, F.Middle, F.Ring, F.Pinky, F.Palm],   # all six channels
    [True,    True,    True,     True,   True,    True],     # True applies, False releases
    [0.6,     0.9,     0.9,      0.9,    0.6,     0.8],      # intensity 0.1-1.0
    [1.0,     1.0,     1.0,      1.0,    1.0,     1.0])      # ramp speed 0.1-1.0
await client.write_gatt_char(CHAR_UUID, data)

In Unity

Most Unity scenes never call the API at all: drop a HexRGrabbable on an object to feel it when grabbed, or a SpecialHaptics zone on a trigger collider to feel it when touched. Both fire from physics.

When you do want explicit control, call PressureTrackerMain on the hand you want to actuate:

csharp
hand.CustomSingleHaptics(Haptics.Finger.Index, true, 0.8f, 1f, false);
hand.CustomSingleVibrations(Haptics.Finger.Palm, true, 0.6f, 12f, false);
hand.RemoveAllHaptics();

The last argument bypasses the hand-near check. Leave it false so feedback only fires when a hand is actually at the object — see the Unity C# reference.