Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Has anyone gotten a controller to work on Hololens/Unity yet?

Discussion in 'Windows Mixed Reality' started by Subere023, Jun 30, 2016.

  1. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    I have a project with a bluetooth game controller that works fine on my dev computer. It pairs fine with the hololens, but registers nothing when the project is running on Hololens.

    Anyone have any luck on this matter yet?
     
  2. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    513
    Hello,

    Do you have standalone input on your event system for the UI controls?

    Thank you,
    Wesley
     
  3. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    Hey Wesley,

    Yeah, I have tried with it and without
     

    Attached Files:

  4. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    513
    Hello,

    Interesting, are you using a Xbox One controller? Are you able to provide more detail on your project?

    Thank you,
    Wesley
     
  5. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    Should that work?? Oh how I have tried. The Xbox One controller is not bluetooth. They do have one coming out at the end of August that adds bluetooth connectivity to what it currently uses. I have both a PS4 and Gamicon bluetooth game controller. Both of which do pair with the device but do not work once the app is deployed to the Hololens.

    There is a thread on the Hololens dev community forums of someone that got a controller to work in a non-unity app.

    The project I am trying to get it working on, is a simple sphere in a spatial map at the moment. I wanted to get a controller working before I dive too deep into that project.
     
  6. eXntrc

    eXntrc

    Joined:
    Jan 12, 2015
    Posts:
    21
    The new controller coming next month for the XBOX S is supposed to have Bluetooth support. It's my understanding that it will show up under Windows as a standard controller, but it's not clear if this will work day 1 with the HoloLens or if any kind of driver will need to be made available over there. This is something I'm looking into myself. I will check back here with you guys as I make progress. Please do the same as you have a chance to mess with it and share your findings.
     
  7. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    hey eXntrc, how are you on the old forums?
     
  8. eXntrc

    eXntrc

    Joined:
    Jan 12, 2015
    Posts:
    21
    I didn't know there were new forums. Where should I be going now? I just had this one bookmarked in my browser.
     
  9. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    513
    There are new forums, but they are still a work in progress
     
  10. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    @eXntrc yeah, I mentioned that the Xbox One S controller could potentially work, but that wait till Aug 31st is a bit bad for progress. But I have other bluetooth controllers that still do not work, and from what I gather no one has been able to get one working. I think it is the reason Brekel made his tool to stream a controller connect to the Hololens.
     
  11. eXntrc

    eXntrc

    Joined:
    Jan 12, 2015
    Posts:
    21
    The problem with using a classic Bluetooth controller like the Moga Pro is that you have to connect it via Bluetooth as an HID device, then you have to process the HID events. I have C++ code to do this and I was working on converting it to C# and wrapping it in Unity, but when I realized the new controllers should theoretically just show up as regular controllers and work with the existing APIs I chose to put that project on hold.

    So, are these forums still the right place to chat about Unity and HoloLens for now (other than the MS forums obviously)?
     
  12. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    513
    This should be the correct place to chat, I will post here if it is not the case.
     
  13. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    Yeah @eXntrc this should be fine. This thread is over in the new forums system, but I am guessing they are having some issues with the new forum. I just did not realize that this forum system was even still in existance
     
  14. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    the PS4 shows up as a wireless controller, while the Matricom shows up as a bluetooth gamepad. I have wondered why the distinction between the 2 products
     
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    5,572
    Unity supports HID devices in the Windows Store player. You don't need to write C++ code for it. It should be as simple as enabling Human Interface Device capability in the manifest.
     
  16. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    @Tautvydas-Zilys I have HID selected for my projects, bluetooth gamepads still have not worked for me. After reading this I went a opened a few of my project just to make sure and HID is selected in all of them.
    My question to you is, have you seen a controller work with a Hololens ? I don't strictly mean from a development standpoint.

    I can not even play minecraft on Hololens with a controller.
     
  17. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    5,572
    Hmm I have not. Though, I assumed it would work the same way as on other Windows Store platforms. Does it work for you if you run the same VS project on the local machine?
     
  18. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    you know, it has with a wired controller. I will try it with the bluetooth controller and see..
     
  19. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    well it appears that the UWP app running on my PC, much like the hololens, does not recognize the bluetooth controller(BC) as well. BC works inside unity. On the other hand a wired xbox360 controller works fine inside UWP.
     
  20. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    @Tautvydas-Zilys

    The other controller, matricom gpad-bx, same story, it works fine in unity and does not work in the compiled UWP app(I also tested both of them with Windows 10 minecraft). Between 1. bluetooth controllers, 2. trying to use Unity Networking for something other than a real time FPS, and 3. the debugger no longer working with VS update 3/HTP b22or b24, I am being really slowed down to almost an absolute stop. Very frustrating.

    On an aside, someone needs to come up with a tutorial for Unity Networking that is not an exact copy of the tutorial you have released. Trying to make something that is not a real-time first person shooter feels like an impossible task for someone that has never done network coding before(and maybe it should).
     
  21. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    5,572
    Silly question, but did you enable bluetooth capability?

    Unfortunately, the guy that implemented all of this is on vacation right now and I'm not too familiar with the area to be able to troubleshoot you better.
     
  22. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    yeah it is enabled unfortunately
     
  23. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
  24. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    5,572
  25. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    1,744
    Hi, I am that guy.

    Can you do this:
    • connect the game controller to PC
    • check that it works in Editor
    • if it doesn't work in UWP, go to Control Panel\Hardware and Sound\Devices and Printers, locate the device, right click Properties->Hardware, select HID-compliant game controller, click Properties->Details, select Hardware Ids, copy those values and paste it here
    Here's an example of a controller connected to my PC.
     

    Attached Files:

  26. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    Hey @Tomas1856

    Thanks for joining the conversation, I hope your vacation was awesome! I just had one myself a few weeks ago.


    This is the first of 2 controllers that I have been trying to get to work with Hololens and UWP
     

    Attached Files:

    Last edited: Jul 24, 2016
  27. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    And here is the other. Both work fine in Unity, and in the windows calibration setup but do not react at all in uwp applications. Hololens or otherwise.
     

    Attached Files:

    • PS4.jpg
      PS4.jpg
      File size:
      108.5 KB
      Views:
      280
  28. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    1,744
    Thanks, that explains the problem, on UWP Unity was only connecting to joysticks (with UsagePage 0x01 and Usage 0x04 as per 'Special purpose hardware ID' table
    https://msdn.microsoft.com/en-us/library/windows/hardware/ff538842(v=vs.85).aspx)

    But it seems the devices you're using, are classified as gamepads - UsagePage 0x01 and Usage 0x05

    I fixed the problem in our main branch, and will graft the fixes to upcoming Unity 5.3 and 5.4.

    Sorry for the inconvience
     
  29. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    44
    @Tomas1856

    Thanks for handling the problem, I look forward to getting progress in this area.
     
  30. deriven

    deriven

    Joined:
    Jul 25, 2016
    Posts:
    9
  31. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    1,744
    Check UsagePage and Usage values (right click Properties on the device->Hardware, select HID-compliant game controller, click Properties->Details, select Hardware Ids) , if it's 0001 and 0005, then most likely yes.

    Just in case, copy-paste the screenshot.
     
  32. deriven

    deriven

    Joined:
    Jul 25, 2016
    Posts:
    9

    Attached Files:

    Tomas1856 likes this.
  33. eXntrc

    eXntrc

    Joined:
    Jan 12, 2015
    Posts:
    21
    Is there a HTP build of Unity that includes these fixes? If so what's the minimum version that supports it? If not, what version can we expect it to show up in?

    Thanks so much Tomas!
     
  34. ScottF

    ScottF

    Director of Development, Mobile Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    76
    The fix has landed in 5.3 and is in queue for 5.4. HoloLens is pulling from 5.4 line so this will propagate into the next release which happens after this lands in 5.4 . Thanks for your patience!
     
  35. deriven

    deriven

    Joined:
    Jul 25, 2016
    Posts:
    9
    I've been seeing some YouTube videos up showing that the Xbox S controller is working (somewhat). I tried my SteelSeries and it doesn't however.

    Is Unity currently only supporting the Xbox S controller for the Hololens? Or am I doing something wrong on my end?
     
  36. jam429

    jam429

    Joined:
    Oct 24, 2015
    Posts:
    1
    FYI: We got a Wireless Xbox One S controller to pair to the HoloLens and work on the latest Unity HTPs, but initially we were missing input from the right stick, the triggers, and some of the buttons. After wrapping some of the gaming APIs, we were able to get input from ALL sticks and buttons. We put a free asset on the Unity Asset Store to accomplish this:

    https://www.assetstore.unity3d.com/en/#!/content/70068
     
    mrbobbybobberson and deriven like this.
  37. deriven

    deriven

    Joined:
    Jul 25, 2016
    Posts:
    9
    That's great, jam! Thanks!

    I'd still like to get confirmation from the Unity team whether other controllers will be supported or is this an Xbox One S monopoly. :)
     
  38. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    5,572
    Can we get a bug report on what doesn't work exactly? All of them should work.
     
  39. deriven

    deriven

    Joined:
    Jul 25, 2016
    Posts:
    9
    Nothing works no matter what I try. I've ordered an Xbox One S controller to compare. Will let you what I find. Hoping it's just something on my end.
     
  40. KarlosZafra

    KarlosZafra

    Joined:
    Sep 8, 2016
    Posts:
    18
    I got the Steelseries Stratus working but the values returned querying the axis do not correspond with a range from -1 to +1. Some of them return -1 on the resting position and others return +1. Has anyone found this?
     
  41. deriven

    deriven

    Joined:
    Jul 25, 2016
    Posts:
    9
    I also got mine to work. I needed to re-pair my Stratus XL and it worked. (Ugh!)
     
  42. KarlosZafra

    KarlosZafra

    Joined:
    Sep 8, 2016
    Posts:
    18
    Did you get the right values for every axis? From -1 to +1?
     
  43. NickLandry

    NickLandry

    Joined:
    Oct 12, 2016
    Posts:
    26
    Has anyone had any luck getting input from an Xbox One S controller paired to a HoloLens via Bluetooth? I have a demo that works successfully within the Unity editor with that same Bluetooth controller, and it also works when I run the UWP build directly on my Windows 10 PC.

    On the HoloLens side, my Xbox One S controller is successfully paired to my HoloLens and I can confirm that the HoloLens receives input within the Settings page or the Xbox app. That said, the controller doesn’t seem to work within my Unity demo on the HoloLens.

    I am running Unity 5.5.0b6 and it was my understanding that based on this thread here that it would be fixed by now. Has anyone had any luck getting controller input working in a Unity app on HoloLens using the default Unity Input settings? (i.e. without wrapping any UWP-only code to map the controller).
     
  44. Hodgson_SDAS

    Hodgson_SDAS

    Joined:
    Apr 30, 2015
    Posts:
    123
  45. mrbobbybobberson

    mrbobbybobberson

    Joined:
    Dec 4, 2016
    Posts:
    2
    With Unity 5.5.0f3 (64-bit) on HoloLens, I'm also observing that every axis comes in as -1 (or if the axis is inverted, +1) no matter what. All the buttons work fine, though.

    Interestingly enough, if I run the Universal Windows App on my laptop running Windows 10 with the same Xbox Wireless Controller connected over Bluetooth, the axes work fine, so it seems to be something HoloLens-specific rather than UWP-specific. My laptop's registry says I'm running 14393.447.amd64fre.rs1_release_inmarket.161102-0100.
     
  46. mrbobbybobberson

    mrbobbybobberson

    Joined:
    Dec 4, 2016
    Posts:
    2
  47. StephenHodgson-Valorem

    StephenHodgson-Valorem

    Joined:
    Mar 8, 2017
    Posts:
    122

    Attached Files:

    Last edited: Sep 7, 2017
  48. StephenHodgson-Valorem

    StephenHodgson-Valorem

    Joined:
    Mar 8, 2017
    Posts:
    122
    I figured it out. In the editor the string name for the controller is different than in the build.

    In Editor the Xbox One S Bluetooth Controller is "Xbox Bluetooth Gamepad"
    In the UWP runtime it's "Xbox Controller" and "Xbox Wireless Controller"
    (Seems to be enumerated twice for some reason)
     
  49. StephenHodgson-Valorem

    StephenHodgson-Valorem

    Joined:
    Mar 8, 2017
    Posts:
    122

    Now that I'm getting controller inputs I'm also running into this problem as well.

    But for the Left Stick, Shared Triggers, and Right Trigger axis' only.

    I wonder what's causing it.

    [Update 1]
    Interestingly enough, when I disconnected and reconnected the device while my app was still running the input axis' did correct themselves, but then the button inputs did not work.

    Closing and opening the app again, resulted in stuck axis' again.

    [Update 2]

    I realized that I was getting motion from all joysticks and that was overriding the axis reading.

    I was running my UWP app from the desktop with a mouse and keyboard. The Event System was putting the x and y axis' (and others) to the joystick's axis reading.
     
    Last edited: Sep 8, 2017
  50. sbagchi

    sbagchi

    Joined:
    Nov 15, 2016
    Posts:
    3
    I've successfully used the "Xbox Controller Input for HoloLens" prefab which is available in the Unity Asset Store. I do have a problem with the controller needing to be re-paired every time I try to use it, though.