Vlog episode 1: Hand Tracking in Meta Quest using Unity


Vlog episode 1: Hand Tracking in Meta Quest using Unity

Passthrough · Hand Tracking · Build & Run · Asset Import — with best practices

Watch the Walkthrough

Objective

Prepare a Unity 6 project for Meta Quest 3 using OpenXR (not the legacy Oculus provider), install Meta XR SDK building blocks, enable passthrough and hand tracking, build & run on-device, and import an Asset Store model. Steps include additional best practices not explicitly stated in the original transcript.

Prerequisites

  1. Unity Editor: Install Unity 6000.2.8 (or newer 6000.2.x) with Android Build Support via Unity Hub:
    • Add modules: Android SDK & NDK Tools, OpenJDK.
  2. Quest Developer Mode: On the headset, enable Developer Mode (Meta Quest app on phone → Devices → your headset → Developer Mode).
  3. USB Debugging: In the headset, enable USB debugging when prompted (allow computer). Keep the link cable connected during Build & Run.
  4. ADB (optional): Ensure adb is available (Unity installs a local copy). Verify with:
    adb devices

Create the Unity Project

  1. Template: In Unity Hub, create a new project using Universal 3D (URP) Core or 3D (URP).
  2. Version Control (recommended): Initialize a Git repo. Add a Unity .gitignore (see Sharing).

Switch Platform to Android

  1. Open File → Build Settings, select Android, click Switch Platform. Wait for conversion.
  2. Add your current scene to the Scenes in Build list.

Enable OpenXR and Meta Quest Features

  1. XR Plug-in Management: Go to Edit → Project Settings → XR Plug-in Management.
  2. Android tab: Enable OpenXR.
  3. Project Validation: Click Project ValidationFix All until no issues remain.
  4. OpenXR Features (Android): In Project Settings → XR Plug-in Management → OpenXR (Android):
    • Enable Meta Quest Support.
    • Enable Hand Tracking Subsystem (and Meta Hand Tracking Aim if present).
    • Under Interaction Profiles, ensure:
      • Meta Quest Touch Plus Controller Profile (Quest 3).
      • Keep any required default profiles Unity auto-adds (e.g., Oculus Touch) if validation insists.
  5. Desktop (optional): On the Desktop tab, also use OpenXR for consistency.

Install XR (Building Blocks)

  1. Open Window → Package Manager.
  2. Click +Add package by name and enter:
    com.meta.xr.sdk.all
  3. Install the components you need. (The All-in-One pulls in Meta XR packages.)
  4. Install XR Hands for hand tracking. In the right panel under Samples, import HandVisualizer.
  5. Accept prompts (e.g., OVRPlugin update). Restart the Editor if requested.
  6. Run the Meta Project Setup tool (Meta → Tools → Project Setup or similar) and click Fix/Apply All until no issues remain.

Scene Setup: Passthrough & Hand Tracking

  1. Open your Sample Scene. Optionally remove the default Main Camera and any global volume if you will use Meta or XR camera rigs.
  2. From the Meta XR SDK Building Blocks:
    • Add a camera rig suitable for OpenXR (e.g., OVRCameraRig from Meta Core or an XR Origin with XR Interaction Toolkit).
    • Add a Passthrough prefab or enable passthrough via the provided components.
    • Add hand-tracking prefabs (e.g., OVRHandPrefab under Left/Right Hand anchors) or configure XR Hands (Unity’s XR Hands package) with visualization.
  3. OVR Manager (if using Meta rig): In the rig’s root object, set Hand Tracking Support to Controllers and Hands (or Hands Only).
  4. To create an XR Origin: right‑click in the Hierarchy → XRXR Origin.
  5. Import the Hand Visualizer: Assets → Samples → XR Hands → <version> → HandVisualizer. Drag HandVisualizer.prefab into the Hierarchy and parent it under XR Origin (VR) → Camera Offset.
  6. Save the scene.

Build & Run on Quest

  1. Connect the headset (USB). Confirm adb devices lists it.
  2. File → Build Settings:
    • Platform: Android.
    • Development Build (optional for logs).
    • Click Build And Run.
  3. If the app does not auto‑launch, open it on the headset under Apps → Unknown Sources.
  4. Headset Settings: Ensure Hand & Body Tracking is ON. Put controllers down to auto‑switch to hands.

Troubleshooting (Hands/Passthrough Not Visible)

  1. Validation: Re‑run Project Validation and Meta Project Setup. Fix remaining issues.
  2. Profiles: Confirm Meta Quest Touch Plus Controller Profile is enabled (Quest 3).
  3. Subsystems: Confirm Hand Tracking Subsystem (and Meta Hand Tracking Aim) are checked under OpenXR (Android) features.
  4. Rig: If using Meta rig, ensure OVR ManagerHand Tracking Support = Controllers and Hands. Attach hand prefabs to hand anchors.
  5. Headset: Hand & body tracking must be ON in system settings. Place controllers down to switch to hands.
  6. Logs: Use adb logcat to inspect runtime issues.

Importing an Asset Store Model

  1. Sign in: Window → Asset Store or Unity Hub/Browser → My Assets.
  2. Import: From Window → Package ManagerMy Assets, select your model (e.g., “Humanoid”), click Download/Import.
  3. Project Organization: Move imported content into project folders (e.g., Assets/Models/YourHumanoid/).
  4. Scene Use: Drag the model/prefab into the scene. Save.

Version Pinning (Reproducibility)

  1. In Package Manager, toggle from Latest to a specific version for critical packages to keep multiple apps consistent.
  2. For Meta XR, you can pin to a specific release instead of latest (e.g., v78) by specifying the version when adding by name.

Optional: Casting for Demos

  1. Use the Meta casting UI (or a desktop receiver) to mirror the headset view while testing your build.

Sharing the Project (Git/GitHub)

  1. In the project root, create a .gitignore that excludes:
    • Library/, Logs/, Temp/, Obj/, Build/, Builds/, UserSettings/, .vs/, and OS cruft.
  2. Commit Assets/ and Packages/ (and ProjectSettings/). Keep Packages/manifest.json & Packages/lock.json for exact dependency lock.
  3. Push to GitHub (private or public). Add a README with your build steps and Unity version.

Quick Reference (Menus & IDs)

  • XR Plug‑in Management: Edit → Project Settings → XR Plug‑in Management.
  • OpenXR (Android) features: Project Settings → XR Plug‑in Management → OpenXR (Android).
  • Meta XR All‑in‑One SDK (Package ID):
    com.meta.xr.sdk.all
  • Build Settings: File → Build Settings → Android → Build And Run.
  • ADB launch (fallback):
    adb install -r path/to/YourApp.apk
    adb logcat | findstr Unity   // Windows quick filter
Best Practice: After your first successful build, tag the repository with the exact Unity and package versions used. This makes future rollbacks painless if a later package update introduces validation or runtime issues.