Microtube Docs
EN中文
Developers / PC VR / Unity PC VR setup

Unity PC VR setup

Build a HEXR Unity project as a Windows app and run it on a Meta Quest over Link.

Package version

These steps need com.microtube.hexr 0.10.7 or newer. Older versions need each glove’s Build Platform set to Window by hand in a Windows build.

Before you start

Start from a project that already works on the Quest: see Unity project setup. PC VR uses the same scenes, rig and backend. You also need Unity’s Windows Build Support module (in Unity Hub, under the editor’s Add modules).

Set up the project

  1. Turn on XR for Windows

    Open Edit → Project Settings → XR Plug-in Management and select the Windows tab. Tick the same provider the Android tab uses: Oculus for Meta OVR, or OpenXR with the Meta Quest feature group.

  2. Leave the gloves as they are

    There is no glove setting to change. On Windows, each glove connects through the PC’s Bluetooth by itself, in a build and in Play mode.

  3. Try it in Play mode

    Start Link (below) and press Play. The scene shows in the headset, and the HexR menu connects the gloves to the PC. You don’t need a build to try a scene.

Build it

Choose HexR → Build PC VR (Windows). It builds the scenes enabled in Build Settings into Builds/PCVR, as a 64-bit Windows app named after your Product Name. Your Android build is not affected.

On a build machine:

text
Unity.exe -batchmode -quit -projectPath . -buildTarget Win64 -executeMethod HexR.EditorTools.HexRPcvrBuild.Build -logFile -

Run it over Link

  1. Start Link on the PC

    Open the Meta Horizon Link app and connect the headset with the cable, or set up Air Link.

  2. Enter Link in the headset

    Open Quick Settings → Link, pick the PC and choose Launch.

  3. Switch on the gloves and run the app

    Start the .exe. Connect each glove from the HexR menu, as on the Quest.

Recommendations

csharp
// Physics at the headset's refresh rate, so held objects don't judder over Link.
void Start()
{
    float hz = OVRPlugin.systemDisplayFrequency;   // 72, 90, 120...
    if (hz > 0f) Time.fixedDeltaTime = 1f / hz;
}

Troubleshooting

ProblemWhat to do
The app opens in a window on the monitor, and the log says “OVRPlugin failed to initialize”Check Link is running and the headset is in Link before you start the app. If it still fails, another program’s OpenXR layer may be stopping XR. Ultraleap’s hand-tracking software is the known one: HEXR switches it off for its own apps from 0.10.7. (To keep it, add HEXR_KEEP_ULTRALEAP to Scripting Define Symbols.) For any other, run the app as below and look for the layer that fails xrCreateInstance in the log
A glove won’t connectA glove talks to one device at a time. Disconnect it in HEXR Companion, and close the Quest app if it is running on the headset. Don’t pair the glove in Windows’ Bluetooth settings; the app connects to it directly
Both left gloves answer, or the wrong one connectsOn a PC each hand takes the first glove with its name. Switch the other kits off, connect once, and the app keeps to that glove next time
Held objects judderRun physics at the headset’s rate (above), or turn on interpolation on their Rigidbodies
Link’s own log says “Package does not exist”That is normal for an app started on the PC, and not the cause of a failure

To see why XR fails to start:

text
set XR_LOADER_DEBUG=all
"Your App.exe" -logFile log.txt

Unity’s own log is in %USERPROFILE%\AppData\LocalLow\<Company>\<Product>\Player.log. Still stuck? Send us the log, your Windows version and the package version.