PICO tutorial project
Get the PICO tutorial project and see how each of its three demos adds haptics.
Get the project
The project is on GitHub: HexR-Developer-Tutorial-Pico ↗. Clone it, or use Code → Download ZIP on that page.
git clone https://github.com/MicrotubeTechnologies/HexR-Developer-Tutorial-Pico.git- Open it in Unity 6000.6.0f1, the version it is saved with. The first time, Unity downloads the HEXR package from GitHub, which takes a while and needs git on your
PATH. - PICO’s OpenXR plugin is already in the project’s
Packages/folder, so there is nothing else to install. - The project uses HEXR
#v0.9.3— one release behind this package; change the pin to#v0.9.4to get its fixes. The pin is the last part of thecom.microtube.hexrline inPackages/manifest.json. - Switch to Android (File → Build Profiles → Android → Switch Platform), Build And Run to your PICO (how to put it on the headset), then connect the gloves from the HexR menu. The first time, allow the Bluetooth permission — on the PICO 4 it is called Location (why it matters).
The demos
One scene holds three demos, and the HexR menu’s DEMOS buttons switch between them. Unity’s XR Interaction Toolkit detects the grab or poke; HEXR decides what the glove does. Select any object in Unity to see its components.
Grab Demo
Four objects to pick up.
| Object | How the haptics are added | What you feel |
|---|---|---|
| Apple pick it up | HexRInteractableHaptics beside the XR Grab Interactable | Pressure on the thumb, index and middle finger |
| Key pinch it | The same component | A pinch on the thumb, index and middle finger |
| Torch grab it, then put a finger in the flame | The same component on all channels. Flame: a SpecialHaptics zone set to Custom Vibrations | The whole hand squeezes; a finger in the flame buzzes |
| Heart pick it up and hold it | HexRGrabbable picks it up, with no XRI. A SpecialHaptics zone on it set to Heart Beat | A slow, steady heartbeat |
Rain Demo
A fountain and a rain cloud. Reach into them.
| Object | How the haptics are added | What you feel |
|---|---|---|
| Fountain put your hand in the water | A SpecialHaptics zone set to Fountain | A fine spray on every finger and the palm |
| Rain hold your palm under the cloud | A SpecialHaptics zone set to Rain Drop | Random taps, like drops landing. Only the palm starts it, so hold your hand flat |
Puzzle Demo
Light every bulb by pressing the buttons. Each button feels different.
| Object | How the haptics are added | What you feel |
|---|---|---|
| Button 1 poke it | The XR Simple Interactable’s Select events call TriggerAllVibrations(0.6) and RemoveAllVibrations() | A slow pulse on the whole hand |
| Button 2 poke it | The same events, calling TriggerAllHapticsIncrease(0.4) | A steady press |
| Button 3 poke it | The same events, calling TriggerAllVibrations(10) | A 10 Hz buzz |
Three ways the demos add haptics
- A component —
HexRInteractableHapticsbeside XRI’s XR Grab Interactable, with nothing to wire. Apple, key, torch. - A trigger zone —
SpecialHapticson a trigger collider, felt by any finger that goes in. Torch flame, heart, fountain, rain. - Interactable events — an XR Simple Interactable’s Select events call a method on a Pressure Controller. The three buttons.
Each one also has a small scene of its own in Assets/Scenes/: 1.Basic Tutorial (component), 2.Special Haptics Tutorial (zones) and 3.Button (events).
How to set up each one in your own project: Haptics setup.