Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

XBox One Bluetooth controller support

Discussion in 'VR' started by trzy, Oct 3, 2016.

  1. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    128
    Hi,

    What is the state of XBox One Bluetooth controller support in Unity? It looks like in another thread that it is not there yet and a third-party asset is required (but this seems like a stop-gap solution at best if other controllers are to be supported as well).

    I managed to finally pair my XBox controller with the HoloLens and notice that Windows apps (such as the Settings application itself) respond to D-pad input but my Unity-based project does not. When running in the editor on a Windows 10 PC, the controller works flawlessly. It's not just a matter of axes being remapped -- none of the buttons or axes seem to work.

    Is there any plan for a future HTP build of Unity to resolve this?

    Thank you,

    Bart
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Did you enable Human Interface Device and Bluetooth capabilities? Which build are you on?
     
  3. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    128
    Thank you, that was the problem! The D-pad and shoulder trigger mappings are different than in the Unity editor but I think this is a known issue. I am using build 5.4.0f3.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Which OS build are you on? For both device and PC that runs the editor? That has been a known change in the way Windows handles mappings in Windows 10 Anniversary update (build 14393). Other than that, there aren't any known issues.
     
  5. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    128
    I'm on build 14393.222 (Version 1607, Win 10 Pro). I've also updated to the latest Windows Holographic build on HoloLens but the issue does not appear to be fixed.
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    And what's the version number of that holographic build? Does the mapping problem happens if you deploy the application to your local machine rather than hololens?
     
  7. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    128
    Windows version 14393.187.x86fre.rs1_release_inmarket.160906-1818

    I'm not sure by what you mean when you say deploy to my 'local machine'. Do you mean generating a build to run on a Windows PC? I'm not sure how to do that (I'm guessing that everything I've #ifdef'ed to work in the Unity editor has to be used). What I do now is run in the editor on my Windows 10 machine and then test in the emulator and deploy to an actual HoloLens.

    Unfortunately, in the emulator, I can't get the controller to be recognized at all. And on the actual device, the mapping of the shoulder trigger and d-pad axes appears to be different.
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Instead of selecting "Remote Machine" in deployment settings, select "Local Machine":

    upload_2016-10-10_10-45-23.png
     
  9. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    128
    Although it builds, I cannot run it in this mode:

    Code (csharp):
    1.  
    2. Severity    Code    Description    Project    File    Line    Suppression State    Tool
    3. Error        DEP0700 : Registration of the app failed. Deployment Register operation with target volume C: on Package Demo-Holocopter_1.0.0.0_x86__pzq3xp76mxafg from:  (AppxManifest.xml)  failed with error 0x80073CFD. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues. (0x80073cfd)    Demo-Holocopter              
    4.  
     
  10. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    128
    By the way, if I understand correctly, the HTP builds of Unity are no longer the latest for HoloLens and the regular 5.5 betas should be used. Could it be that my version of Unity (5.4.0f3) needs to be updated to a 5.5 release?
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Is Windows developer mode enabled in settings?

    upload_2016-10-11_10-12-56.png
     
  12. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    128
    Yes, it definitely is. Just checked. (Without this, I don't think it's even possible to deploy to the device.)
     
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Are you able to reduce the controller differences issue to a separate small project that could be shared with us for investigation?
     
  14. Hodgson_SDAS

    Hodgson_SDAS

    Joined:
    Apr 30, 2015
    Posts:
    123
    Last edited: Oct 12, 2016
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Could you make that into a project and submit it as a bug report? It's not really clear from that link alone what we should look at exactly.
     
  16. Hodgson_SDAS

    Hodgson_SDAS

    Joined:
    Apr 30, 2015
    Posts:
    123
    It's a pull request for controller support into the HoloToolkit-Unity
     
  17. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Uhh sorry. Somehow misread your username and thought it was the OP who linked that as some kind of bug explanation.
     
  18. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    128
    Sorry for the delayed response but I just found some time to put together a very minimal project. You can see that under Input Settings, I've added "LeftTrigger" and "RightTrigger" as 9th and 10th axes, respectively. This configuration allows me to use the trigger buttons in the Unity editor. On the actual device, however, this leaves RT at 1 by default and it looks like the D-pad is mapped in some weird way to RT. One of the D-pad directions even produces a reading of 0.43 (?) on RT, even though it's a digital axis.

    Let me know if you have any trouble getting this project to run. It's available at: http://www.trzy.org/tmp/ControllerDemo.zip
     
  19. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Can you submit it as a bug report through the editor? Just so it doesn't get lost.
     
  20. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    128
    Yup -- just submitted it. Thank you!
     
  21. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    128
    BTW, I just tried it with Unity 5.5.0b7 but it still suffers the same problem. By default, the right trigger axis returns 1.0. Pressing right on the D-pad sets it to 0.43, and so forth.