Getting Started
Install the HEXR SDK, trigger your first haptic event, and learn the core concepts — for Unity and Python.
Overview
HEXR is a haptic glove for VR and mixed reality. You cannot plug it into an app that already exists. You build the app, and you add HEXR scripts to every object the user should feel.
You need four things:
An app you built
In Unity or Python. There is no driver that adds haptics to someone else's app.
A Bluetooth connection from that app
Your app connects to the glove while it is running, using
ConnectLeftBT()/ConnectRightBT()or a connect button in your scene. You do not pair it in system settings.Hand tracking
From your headset, or from Leap Motion. HEXR does not track hands.
HEXR scripts on your objects
Objects do nothing by default. Add
HexRGrabbable,SpecialHapticsorProximityCheckto each one.
Then set intensity, speed and frequency, per finger. Latency is under 20 ms. To skip to code, see the Quickstart.
Prerequisites
- A HEXR glove and arm module (Glove 2.0)
- A headset with hand-tracking — Meta Quest 2 / 3 / 3S, Pico 4 or HoloLens — or an external tracker such as Leap Motion. HEXR needs one of these to know where your hand is.
- To build in Unity: Unity 2022.3 or newer, and git installed on your
PATH. Unity uses git to download the HEXR package. - To build in Python: Python 3.9 or newer.
New to HEXR hardware? Power on the arm module first — there is no separate setup app, your own project opens the connection. The kit is covered in The kit & hardware.
Installation
Choose your platform below.
HEXR ships as a Unity package called com.microtube.hexr. You can add it to any Unity 2022.3 or newer project. Add it by git URL — Add package by name will not find it, because the package is not on a registry.
Open Package Manager
In Unity, go to Window → Package Manager.
Add the package from its git URL
Click the + button in the top-left corner and choose Add package from git URL…. Paste the URL below, then click Add.
https://github.com/MicrotubeTechnologies/com.microtube.hexr.gitThat URL has no version on the end, so you get the latest release. If you need a project to stay on one exact version, add #v0.4.0 to the end. Unity remembers whichever one it fetched, so to pick up a newer release later use Window → Package Manager → com.microtube.hexr → Update.
Everything the glove needs comes with the package — the HaptGlove runtime and the Bluetooth support for Windows, Android and macOS. There is nothing else to download.
Next, choose an XR backend. HEXR works with either one, and it does not install one for you — you pick the one your project uses. Open HexR → HexR Tools → Project Setup and install whatever it lists as missing.
- OpenXR — every package comes from Unity's own registry, so the installer handles it in one click.
- Meta OVR — the Meta XR SDK is not on Unity's registry, so you have to add it to your Unity account once before Unity can install it. Open the free Meta XR All-in-One SDK on the Asset Store and click Add to My Assets. Then in Unity: Window → Package Manager → My Assets → Meta XR All-in-One SDK → Install. Project Setup has buttons for this, and a Re-scan to pick it up afterwards.
Prefer to start from a scene that already works? Each tutorial project ships the package plus a demo scene:
- OpenXR tutorial — Unity + OpenXR plugin
- Meta OVR tutorial — Unity + Meta OVR plugin
- MRTK tutorial — Unity + Mixed Reality Toolkit
If your project already carries its own copy of HaptGlove.dll or the ArduinoBluetoothAPI* binaries under Assets/Plugins/, delete them before installing. Two copies of the same assembly is a hard compile error, not a warning.
Clone the Python repo and install its dependencies:
git clone https://github.com/MicrotubeTechnologies/HaptGlovePython.git
cd HaptGlovePython
pip install -r requirements.txtThen run AddressDiscovery.py to find your glove's Bluetooth address and set it in ExampleHaptics.py.
The Python control library talks to the glove over Bluetooth (BLE) using bleak. It's run from a clone, not yet published as a pip package — adding a pyproject.toml to the repo would enable pip install.
Quickstart
Connect to a glove and fire a short pulse when the user touches an object.
Once the package is installed and you have chosen a backend, these four steps take a scene from empty to working haptics:
Add a hand-tracking rig to your scene
HEXR attaches to a hand-tracking rig that is already there; it does not create one. Use Meta Building Blocks' Hand Tracking block, or an OpenXR rig with
com.unity.xr.hands.HexR → Create HexR Rig
Pick Open XR or Meta OVR. This drops in the
HexR Mainrig and the Pressure Controllers that drive the glove.HexR → Auto Setup Scene
Wires the hand roots, fingertip and palm colliders, and the Pressure Controllers together.
HexR → Validate Scene Setup
Reports anything still unwired before you press Play.
From there, drive the glove directly from any script. PressureTrackerMain is the per-hand haptics controller — one on each Pressure Controller:
using UnityEngine;
using HaptGlove;
using HexR;
public class TouchPulse : MonoBehaviour
{
public PressureTrackerMain hand; // the Left or Right Pressure Controller
void OnTriggerEnter(Collider other)
{
// finger, on, intensity 0.1-1, ramp speed 0.1-1, bypass the hand-near check
hand.CustomSingleHaptics(Haptics.Finger.Index, true, 0.8f, 1f, false);
}
void OnTriggerExit(Collider other)
{
hand.CustomSingleHaptics(Haptics.Finger.Index, false, 0f, 1f, false);
}
}Most scenes never need this: drop a HexRGrabbable or SpecialHaptics component on an object and it fires haptics from physics alone. See the Unity C# reference.
Haptics only fire while HEXR believes a hand is near. On OpenXR the only thing that sets this is a ProximityCheck with a trigger collider on the object — without one, nothing fires and it looks exactly like broken hardware. Meta OVR gets it from its grab and poke interactors instead. Validate Scene Setup flags this.
import asyncio
from bleak import BleakClient
from Haptics import Haptics
DEVICE_ADDRESS = "EC:C9:FF:45:92:86" # your glove (see AddressDiscovery.py)
CHAR_UUID = "0000ff01-0000-1000-8000-00805f9b34fb"
async def main():
haptics = Haptics("right")
async with BleakClient(DEVICE_ADDRESS) as client:
# All six channels. Fingers are Haptics.Finger members, not strings.
F = Haptics.Finger
data = haptics.hexr_pressure_multiple(
[F.Thumb, F.Index, F.Middle, F.Ring, F.Pinky, F.Palm], # channels
[True]*6, # True applies, False releases
[0.8]*6, # intensity 0.1-1.0
[1.0]*6) # ramp speed 0.1-1.0
await client.write_gatt_char(CHAR_UUID, data)
await asyncio.sleep(5)
asyncio.run(main())Always check that a glove is connected before sending events — calls to a disconnected glove are ignored, but polling in a tight loop can flood the driver. Gate feedback behind your interaction callbacks.
Core concepts
Haptics triggers
There are two ways to fire haptics. You can raise an event in your own code, on a touch, a grasp or a release. Or you can let physics do it, by putting a collider on the object so that contact fires the feedback on its own. Use events when you want precise control over the moment, and colliders when you want touch to just work.
Collider-based touch
HEXR puts a trigger collider on each fingertip and on the palm. When one of them overlaps an object's collider, the feedback fires automatically. This is the hands-off route: you feel objects in the scene without writing any event wiring at all.
Actuators & fingers
Each glove exposes soft pneumatic actuators mapped to the fingers. You address feedback per finger, with a target intensity, a speed to reach it, and a frequency for vibration.
| Parameter | Type | Description |
|---|---|---|
| finger | Finger | Which finger to actuate (Thumb…Pinky) |
| intensity | float 0–1 | Target pressure of the actuation |
| speed | float 0–1 | How fast it ramps to the target intensity — 1 reaches it as fast as possible, 0.1 ramps up slowly |
| frequency | 0–40 | Adds vibration to the actuation — 0 is steady pressure, higher values vibrate faster |
Hand-tracking
HEXR does not track your hand on its own — it relies on external hand-tracking, either from your headset (Meta Quest 2/3/3S, Pico 4, HoloLens) or a device like Leap Motion. HEXR adds the touch-feedback layer on top of that tracking.
For the full Unity setup, read Unity integration, then the Unity (C#) reference for every component and method. For Python, start with Python integration.