Skip to main content
Version: 14 Oct 2024

Controller Tracked Pose Driver

Unity Input System - Tracked Pose Driver

The Tracked Pose Driver component is provided by Unity and allows objects to mirror the positional and rotation input of any input device. Perform the following steps to track the position of the controller:

  1. Add a Tracked Pose Driver (Input System) component to the target transform.
  2. Set the tracking type to Rotation And Position.
  3. In the Position Input section, select the + icon, and set the path to MagicLeapController/devicePosition or XRController/devicePosition.
  4. Next in the Rotation Input section, select the + icon, and set the path to MagicLeapController/deviceRotation.
Unity Input System's Tracked Pose Driver Component

Control Binding Paths

Unity's Input System can look up Controls using paths. Bindings on Input Actions rely on this feature to identify the Control(s) they read input from. However, you can also use them for lookup directly on Controls and Devices, or to let the Input System search for Controls among all devices using InputSystem.FindControls.

See Unity's Control Path documentation to learn more.

ActionBinding Path
BumperMagicLeapController/gripbutton
Is TrackedMagicLeapController/isTracked
MenuMagicLeapController/menubutton
PositionMagicLeapController/devicePosition
RotationMagicLeapController/deviceRotation
TouchpadMagicLeapController/primary2daxis
MagicLeapController/mlcontrollertouchforce
Touchpad (2nd Finger Touch)N/A
TriggerMagicLeapController/TriggerAxis

XR - XR Controller

Alternatively, you can use either the action based or the device based XRController components.

Device Based

  1. Add a XR Controller (Device-based) component to the target transform.
  2. Enable Input Tracking.
  3. Next, enable Input Actions.
  4. Finally, set the Controller Node to Game Controller.
Unity's Device Based XR Controller Component

Action Based

  1. Add a XR Controller (Action-based) component to the target transform.
  2. Enable Input Tracking
  3. Under the Position Action, select the + icon, and bind the position to devicePosition [XR Controller]
  4. Finally, in the Position Action, select the + icon, and bind the rotation to deviceRotation [XR Controller]
Unity's Action Based XR Controller Component