Windows Mixed Reality motion controllers allow users to interact in Mixed Reality applications, allowing precise, low latency tracking of movement within the field of view (FOV) of their Windows Mixed Reality headset. This is achieved using the sensors built into the headset.
To allow native Unity Editor support for Windows Mixed Reality input hardware, the Unity VR subsystem presents three inputs as separate joysticks. Use the UnityEngine.Input class to read the axis and button values of these inputs.
When properly configured and connected to your computer, the motion controllers appear in the list returned by UnityEngine.Input.GetJoystickNames() as Spatial Controller - Left and Spatial Controller - Right. For information on correctly configuring and connecting the motion controllers, see the Windows Developer Center documentation.
In Unity you can check the availability of the controllers through script by periodically checking for their presence in the list of joystick names. When the controllers are turned off, or their batteries are removed, an empty string replaces their name in the list returned by UnityEngine.Input.GetJoystickNames(). When the controllers are turned back on, their name re-appears in the list.
The image below shows the buttons available on your Windows Mixed Reality controller.
The table below shows the interaction types, button IDs, axis and value ranges for each input provided by the controller in Unity.
Hardware Feature | Interaction Type | Unity Button ID | Unity Axis ID | Unity Axis Value Range |
---|---|---|---|---|
Touchpad | Touch | Left: 18 Right: 19 |
- | - |
Touchpad | Press | Left: 16 Right: 17 |
- | - |
Touchpad | Horizontal Movement | - | Left: 17 Right: 19 |
–1.0 to 1.0 |
Touchpad | Vertical Movement | - | Left: 18 Right: 20 |
–1.0 to 1.0 |
Thumbstick | Press | Left: 8 Right: 9 |
- | - |
Thumbstick | Horizontal Movement | - | Left: 1 Right: 4 |
–1.0 to 1.0 |
Thumbstick | Vertical Movement | - | Left: 2 Right: 5 |
–1.0 to 1.0 |
Select Trigger | Press | Left: 14 Right: 15 |
- | - |
Select Trigger | Squeeze | - | Left: 9 Right: 10 |
0.0 to 1.0 |
Grip button | Press | Left: 4 Right: 5 |
- | - |
Grip button | Squeeze | - | Left: 11 Right: 12 |
0.0 and 1.0* |
Menu button | Press | Left: 6 Right: 7 |
- | - |
Windows Mixed Reality controller input details for Unity
*The Grip squeeze axis is a binary control, so it only reports values of 0 or 1, with no values in between.
The table below lists the different axes available when using Window Mixed Reality controller inputs, along with the positive and negative directions for each axis.
Axis | Positive Direction | Negative Direction |
---|---|---|
Horizontal | Left | Right |
Vertical | Up | Down |
For more information on using the Windows MR motion controllers with Unity, visit the Windows Developer Center documentation on Motion Controllers in Unity.
2017–11–21 Page published with editorial review
New functionality in 2017.2
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thanks for helping to make the Unity documentation better!