Microtube Docs
EN中文
Developers / Unreal / Pawn & hands setup

Unreal pawn & hands setup

Give your VR pawn tracked hands, connect the gloves and put the app on the headset.

What a HEXR pawn needs

Three components. Your VR pawn carries them; Tools → HexR → Add HexR Rig to Level brings a pawn that has them all.

ComponentWhat it doesHow many
HexR Tracked HandFollows the headset’s hand tracking and moves six touch points with it: one on each fingertip and one on the palm. A haptic fires when a touch point enters a HEXR component. It also measures how curled each finger isOne per hand. In the Details panel, set Hand to Left on one and Right on the other
HexR Pressure ControllerEvery haptic for its hand goes through it. It also holds the hand-near checkOne per hand, with Hand set to match
HexR Recenter (optional)Brings the wearer back to where the level started them, without resetting the tracking originOne

The gloves belong to the engine, not the level. They stay connected when a level loads and, in the editor, between Play sessions.

Build a new level

  1. Add the HexR rig

    Choose Tools → HexR → Add HexR Rig to Level. It places BP_HexRRig at the Player Start and makes it the pawn the player gets. Other pawns stop auto-possessing; Undo puts them back.

  2. Add the HexR menu

    Choose Tools → HexR → Add HexR Menu for the panel that connects the gloves in the headset (below).

  3. Validate

    Run Tools → HexR → Validate Project.... Its last rows check the open level.

  4. Connect a glove

    In the editor, connect from Tools → HexR Tools, then press VR Preview: the gloves stay connected. On the headset, press the glove’s button on the HexR menu.

Check: select BP_HexRRig in the Outliner and tick Show Touch Points in the Details panel. In VR Preview, a marker follows each fingertip and your palm.

Add HEXR to an existing pawn

To keep a pawn you already have, such as the VR Template’s BP_XRPawn:

  1. Add the components

    Open the pawn’s Blueprint. In the Components panel, press Add and add two HexR Tracked Hand and two HexR Pressure Controller components.

  2. Set the hands

    In the Details panel, set Hand to Left on one of each and Right on the other.

  3. Connect the gloves

    Tick Connect Gloves on Start in Project Settings → Plugins → HexR, or connect from Blueprint (below). Add the menu with Tools → HexR → Add HexR Menu.

  4. Keep your grabs

    The VR Template’s grabbable objects already press the hand that holds them. See VR Template grabs.

Seeing your hands

The HexR Tracked Hand draws the hand itself, as joints and bones, so you see your hands with nothing else added. If you use your own hand meshes, or the ones your template shows, untick Show Hand on each HexR Tracked Hand.

To see where the touch points sit, tick Show Touch Points. Tip Radius, Tip Offsets, Palm Size and Palm Offset change their size and place, in centimetres.

The panel that floats in the headset. Its main job is connecting the gloves. It stays where the level puts it. Press its buttons with either index fingertip, and the glove taps that finger. To move it, pinch the HEXR MENU header and move your hand.

The HexR menu: the GLOVES, VIEW, HAPTICS and SCENES sections
The HexR menu. Connect each glove, show the touch points, watch the haptics and switch levels from here.
On the menuWhat it does
GLOVES: a button per gloveShows what the glove is doing. Press it to connect, and again to disconnect
Search nearby, Forget glovesList the HEXR gloves in range to pick one, or forget the gloves this headset remembers
VIEW: Show CollidersDraws the touch points on your hands
RecenterBrings you back to where the level started you
HAPTICSShows live what each channel of each glove was last sent
SCENESSwitches between the levels in Menu Scenes
DEMOS, DEMO: RestartYour own buttons, and a button that restarts the level

On the menu actor, in the Details panel:

From Blueprint, Toggle Menu, Set Menu Visible and Summon show and move it. The console command HexR.Menu shows or hides it.

Connect the gloves

Switch the glove on, then connect from your app. Don’t pair it in the headset’s Bluetooth settings. Pick one way:

cpp
#include "HexRSubsystem.h"
#include "HexRManager.h"

// In your pawn (or game mode). The gloves belong to the engine, not the level,
// so they stay connected when a level loads.
void AMyPawn::BeginPlay()
{
    Super::BeginPlay();
    UHexRSubsystem* HexR = UHexRSubsystem::Get(this);
    UHexRManager* Manager = HexR ? HexR->GetManager() : nullptr;
    if (!Manager) return;

    Manager->OnGloveConnected.AddDynamic(this, &AMyPawn::OnGloveConnected);   // a UFUNCTION(EHexRHand Hand)
    // Asks for the Bluetooth permission first where the headset needs it.
    // Does nothing for a glove that is already connected or connecting.
    Manager->ConnectHand(EHexRHand::Left);
    Manager->ConnectHand(EHexRHand::Right);
}

A glove that drops reconnects by itself, retrying for up to a minute. Before a glove disconnects, and when play ends or the app pauses or quits, HEXR releases every channel, so nothing stays pressed. Toggle Hand does what the menu’s glove button does: connect, cancel a connect in progress, or disconnect.

Put the app on the headset

Package the app, then install it. The headset needs developer mode first.

Turn on developer mode

Once per headset.

HeadsetHow
Meta QuestIn the Meta Horizon app on your phone, open your headset’s settings and turn on Developer Mode. Meta may ask you to set up a free developer account first
PICOOn the headset, go to Settings → General → About and tap the software version until developer options appear. Then turn on Settings → Developer → USB Debugging

Then plug the headset into your computer and accept the Allow USB debugging prompt inside the headset.

Package and install

  1. Package

    Choose Platforms → Android → Package Project and pick a folder. Unreal writes the APK there, with the game’s data in a separate .obb file.

  2. Install

    With the headset plugged in, run the Install_….bat file Unreal wrote beside the APK. It installs the APK and copies the data file across.

Installing the APK alone, with adb install, SideQuest or Meta Quest Developer Hub, leaves the data file behind. To use those tools, tick Package game data inside .apk? in Project Settings → Platforms → Android first:

shell
adb install -r YourApp.apk

Finding it on the headset: installed apps don’t sit with your store apps. On Quest, open the app library and choose Unknown Sources. On PICO, look in the Library’s unknown-sources filter.

Allow Bluetooth on the headset

The first time the app connects a glove, the headset asks for permission to use Bluetooth. Allow it. If it is refused, the app keeps running but never finds the glove. HEXR asks for it for you.

HeadsetThe permission is calledRefused it? Turn it on under
Meta Quest 2, 3, 3S, ProNearby devicesSettings → Privacy and Security → App Permissions, then restart the app
PICO 4Location, with the headset’s Location switch onSettings → Apps, your app, Permissions, then restart the app
PICO 4 Ultra, and other headsets on Android 12 or laterNearby devicesSettings → Apps, your app, Permissions, then restart the app
Glove won’t connect?

Check this permission first, before the glove or your project.

If a glove won’t connect

Next

Make things felt: Haptics setup.