Skip to main content
Version: 12 Dec 2024

Input Bindings

Input Binding Paths

This guide explains how to access HMD data from OpenXR in Unity using the Input System's built-in HMD bindings.

HMD device layout

The OpenXR Plugin provides a device layout for the HMD, which inherits from the <OpenXRHmd> layout. This layout has four elements: centerEye, device, leftEye, and rightEye. Each element has four controls: position, rotation, velocity, and angularVelocity. These controls are exposed in the Unity Input System through the following bindings:

NamePathTypeControlTypeInitialStateCheck
Position<OpenXRHmd>/devicePosition
<OpenXRHmd>/centerEyePosition
ValueVector3True
Rotation<OpenXRHmd>/deviceRotationValueQuaternionTrue
Status<OpenXRHmd>/trackingStateValueIntegerTrue

Tracked Pose Driver

The Tracked Pose Driver allows objects to mirror the positional and rotation input of any Input Device. To track the HMD position :

  1. Add a Tracked Pose Driver (Input System) component to the target transform.
  2. Set the Tracking Type to Rotation And Position.
  3. For the both the Position and Rotation input set the Input Action binding path to XR HMD.
Unity's Tracked Pose Driver Component