Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

How to use inputs from Unity?

demonixisdemonixis
edited July 2017 in Q&A and Discussions

Hi there,

Since the last update I'm able to test my work from the Unity Editor, which is great. However I can't test input. My game works with Gamepad, Keyboard or motion controller, but when I try it from Unity, my gamepad or keyboard don't have the focus. Do you know what do I have to do to get it working?

I have also another question, is it possible to simulate the motion controllers? Is it mapped in Unity like the Oculus Touch and the Vive's wands? How to test them?

Thanks!

French XR/MR developer / Indie Game Developer

Tagged:

Best Answer

Answers

  • but when I try it from Unity, my gamepad or keyboard don't have the focus

    Have you tried the latest MRTP13 ?

    is it possible to simulate the motion controllers?

    Currently, only mouse, keyboard and Gamepad input simulation is supported. If you get the motion controller and complete the setup with your PC, you should can test them in Unity Play mode.

  • Hi,

    I don't have access to this version, but I can't use anything that Unity 2017 because all my code was converted to C# 4.6. So if I understand, this input issue is related to Unity 2017.2 beta 4 and the MRTP13 allows devs to use a gamepad or the mouse from the Unity Editor in their application?

    French XR/MR developer / Indie Game Developer

  • @FranklinChen where does one get access to MRTP13? We are using 2017.2 and having a similar problem that we can't get controllers to work in Play mode. Forum post here.

  • @anandx it looks like this issue is for all types of inputs :/ I suspect a focus issue. Because Unity is a Win32 apps and YOU are in VR, so the focus is set on the VR content and not the Unity Editor. In fact if click using your mouse, you'll hear few sounds.

    French XR/MR developer / Indie Game Developer

  • GruguirGruguir
    edited August 2017

    untested (i just understood how to build) but could it maybe work using 'XR.WSA.Input' ? https://docs.unity3d.com/2017.2/Documentation/ScriptReference/XR.WSA.Input.SourcePressedEventArgs.html

    Edit : oh i misunderstood, the issue only happens in editor ?

  • @anandx said:
    @FranklinChen where does one get access to MRTP13? We are using 2017.2 and having a similar problem that we can't get controllers to work in Play mode. Forum post here.

    Please see this document: Install the tools

    The public builds of Unity do not yet include support for building mixed reality apps on Windows desktop. Until public builds are available, you'll need to acquire a private build of the Mixed Reality Technical Preview (MRTP) by working with your Microsoft account manager. Please do not attempt to contact Unity directly for this access.

    You can tell your Microsoft contact to find the right person to help you on this request.

  • HoloToolkit-Unity MRTP13 is released but there's a note that says :

    Top Unity known issue:
    • Gamepad input doesn't work if Holographic HMD has focus during
    playmode [925608]

  • What about launching from an actual app and now from the editor?

    Microsoft HoloLens Agency Readiness Program Partner
    Developer, Immersive Experiences at Valorem | LinkedIn Profile
    Moderator for Microsoft's open source HoloToolkit for Unity

  • This issue should be fixed in the latest Unity 2017.2.0b10 build. It was just an issue with the game window losing focus when launching into the MRP.

  • edited September 2017

    @Jesse_McCulloch Yeah I tried using b10 but I'm not running from the editor, but from a build launched through the Mixed Reality Portal. I kept getting Unimplemented Controller type Detected: Xbox Wireless Controller in the output window when debugging from Visual Studio.

    I just ported stuff from a previous version of Unity that was working fine, but now seems to be broken.

    Microsoft HoloLens Agency Readiness Program Partner
    Developer, Immersive Experiences at Valorem | LinkedIn Profile
    Moderator for Microsoft's open source HoloToolkit for Unity

  • Microsoft HoloLens Agency Readiness Program Partner
    Developer, Immersive Experiences at Valorem | LinkedIn Profile
    Moderator for Microsoft's open source HoloToolkit for Unity

  • Microsoft HoloLens Agency Readiness Program Partner
    Developer, Immersive Experiences at Valorem | LinkedIn Profile
    Moderator for Microsoft's open source HoloToolkit for Unity

  • edited September 2017

    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)

    Microsoft HoloLens Agency Readiness Program Partner
    Developer, Immersive Experiences at Valorem | LinkedIn Profile
    Moderator for Microsoft's open source HoloToolkit for Unity

  • In the UWP runtime it's "Xbox Controller" and "Xbox Wireless Controller"
    (Seems to be enumerated twice for some reason)

    How did you find out which name it gets in UWP ?

Sign In or Register to comment.