Requirements:
Windows 10(Build 1709 or later).
Unity 2017.3 or later.
Visual Studio 2017 or later.
Microsoft Mixed Reality Toolkit
Windows Dev Center for Mixed Reality
Unity's Input Manager for Windows Mixed Reality motion controllers
Develop Mixed Reality Apps for Holographic Technology
Unity development overview for Windows Mixed Reality Apps
Windows Mixed Reality Developer Forum
Windows Mixed Reality Unity Forum
Instructions:
-
Pair your Xbox One S Wireless Controller to your HoloLens using the Bluetooth section of HoloLens Settings and following the instructions of your controller.
-
Make sure your Unity WSA project has the following capabilities set:
InternetClient HumanInterfaceDevice
-
Set up the script you are going to use for input as follows. (You can follow the example of the scene “ExampleScene” and the script “ControllerInputExample” to see how to use the code)
a. Add the using directive “using HoloLensXboxController;”
b. Add a private member “private ControllerInput controllerInput;”
c. Instantiate the controllerInput object in the Start() method: ie “controllerInput = new ControllerInput(0, 0.19f);”. The first parameter of the constructor is the number, starting at zero, of the controller you want to follow. The second parameter is the default “dead” value; meaning all stick readings less than this value will be set to 0.0.
d. Make sure to call “controllerInput.Update();” in your MonoBehaviour Update() method.
-
Build and deploy your application to HoloLens.
-
Note: these libraries will only handle Input on the HoloLens. They will not handle input in the Unity Editor. You will need to handle that separately.