Input Binding Paths
Unity's Input System can locate Controls using paths. Bindings on Input Actions utilize this feature to identify the Control(s) they receive input from. You can also use paths to directly look up Controls and Devices, or to have the Input System search for Controls among all devices using the InputSystem.FindControls
method.
This guide outlines the input paths and control profiles supported on Magic Leap 2. For general information about OpenXR Input in Unity, refer to the Unity OpenXR Plugin Input Manual.
Additional Resources:
Magic Leap Controller Profile
Name | Path | Type | ControlType | InitialStateCheck |
---|---|---|---|---|
PointerPosition | <MagicLeapController>/pointer/position | PassThrough | Vector3 | FALSE |
PointerRotation | <MagicLeapController>/pointer/rotation | PassThrough | Quaternion | FALSE |
Velocity | <MagicLeapController>/devicePose/velocity | PassThrough | Vector3 | FALSE |
AngularVelocity | <MagicLeapController>/devicePose/angularVelocity | PassThrough | Vector3 | FALSE |
MenuButton | <MagicLeapController>/menu | Button | Button | FALSE |
Bumper | <MagicLeapController>/gripPressed | Button | Button | FALSE |
Trigger | <MagicLeapController>/triggerPressed | Button | Button | FALSE |
TriggerValue | <MagicLeapController>/trigger | Value | Axis | TRUE |
Trackpad | <MagicLeapController>/trackpad | PassThrough | Vector2 | FALSE |
TrackpadClick | <MagicLeapController>/trackpadClicked | PassThrough | Button | FALSE |
TrackpadTouch | <MagicLeapController>/trackpadTouched | PassThrough | Button | FALSE |
TrackpadForce | <MagicLeapController>/trackpadForce | PassThrough | Axis | FALSE |
Haptics | <MagicLeapController>/haptic | PassThrough | Haptic | TRUE |
Position | <XRController>/devicePosition | Value | Vector3 | FALSE |
Rotation | <XRController>/deviceRotation | Value | Quaternion | FALSE |
IsTracked | <XRController>/isTracked | Value | Button | TRUE |
Status | <XRController>/trackingState | PassThrough | Integer | TRUE |
To specify a input detect when the controller is being held in a specific hand instead of either, you can add {LeftHand}
or {RightHand}
after the <XRController>
or <MagicLeapController>
in the binding path.
Generic XR Bindings
Developers can also use the following Common Usage Bindings:
Name | path | Type | ControlType | InitialStateCheck | Description |
---|---|---|---|---|---|
devicePosition | <XRController> /devicePosition | Vector3 | Position | False | Tracks the position of the device in 3D space. |
deviceRotation | <XRController> /deviceRotation | Quaternion | Rotation | False | Tracks the rotation of the device in 3D space. |
deviceVelocity | <XRController> /deviceVelocity | Vector3 | Velocity | False | Tracks the velocity of the device moving in 3D space. |
deviceAngularVelocity | <XRController> /deviceAngularVelocity | Vector3 | AngularVelocity | False | Tracks the angular velocity of the device rotating in 3D space. |
trigger | <XRController> /trigger | float | Axis | False | Represents the amount the trigger is pressed. |
gripButton | <XRController> /gripButton | bool | Button | False | Indicates if the bumper button is pressed or not. |
menuButton | <XRController> /menuButton | bool | Button | False | Indicates if the menu button is pressed or not. |
primary2DAxisTouch | <XRController> /primary2DAxisTouch | bool | Touch | False | Indicates if the primary 2D axis is being touched. |
primary2DAxis | <XRController> /primary2DAxis | Vector2 | Stick | False | Tracks the movement of the touchpad on the 2D axis. |
Khronos Simple Controller Profile
The Magic Leap 2 controller also supports the Khronos Simple Controller Profile which can be used to create cross platform input actions. These actions can be bound under the root <KHRSimpleController>
path. To use the Khronos Controller profile bindings, see Unity's Khronos Controller Profile Documentation.