Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

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.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. 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. And always feel free to hit us up on Twitter @MxdRealityDev.

Motion Controllers not tracked on Unity builds

albmarvilalbmarvil
edited September 2017 in Q&A and Discussions

Hello everyone,

I am new working with Microsoft Mixed Reality. Right now I am working with the Acer Immersive Reality Headset and the motion controllers. I wanted to give feedback about a problem that we are having with Motion Controllers and see if we can come up with a solution.

First lets describe the set-up:
-Game developed with Unity 2017.2.0f1 (Beta Release Candidate)
-Windows Insider preview build (Version 1709, OS Build 16296.0)

I am not using the toolkit published on GitHub since it is no stable (the Dev branch is in the process of being merged with the Master branch) and it includes a lot of things that are not useful for my project right now.

To get the controller Input and motion tracking pose, I am using the "InteractionManager" class in the namespace "UnityEngine.XR.WSA.Input".

The problem that I am having is that I am not getting any kind of input when I play the app on Unity Editor or from the build package.

The only moment when I can get any kind of data from this class (or the InputTracking class from Unity) is when I do the following steps:

  1. Unmount the headset
  2. Press and hold the play button on Unity Editor
  3. Mount the headset
  4. Unity loses the mouse focus and the app starts

Doing this I can get all the Input readings. Buttons, touchpad, joystick, position tracking, everything.

I just want to point out that this ONLY WORKS on Unity Editor doing the specified process. It doesn't work on builds or just pressing the play button.

I want to know if someone is having the same issue, in that case, is this problem something that we can fix as developers?

Otherwise I want to warn the mods here, so they can clear this problem for us.

Thanks!

Comments

  • Hi albmarvil.

    Just to say I have the same issue. I am using the last current commit of the Dev_Unity_2017.2.0 (eca43b6b) with Unity2017.3.0b2. I use the MotionControllerTest scene.
    The headset is working, but as you, no Motion Controller at all. It works only one time in play mode over 20+ attempts, no clue why.

    I am wondering if it is not because we are not using the Unity MRTP build version...

    Keep in touch

  • OrionOrion
    edited October 2017

    Test case:
    1- Just start Unity : no controller
    3- Start Unity from Windows VR house : no controller
    2- Start the Unity as usual, press "Windows" button to go back to the Windows VR house, from there click to go back to Unity apps : Controllers working !
    3- Start Unity from Windows VR house, go back to VR House using the "Windows" button, go back to the game : controllers working

  • Hey, having the same issue and Orion's test-case solution also works for me too.
    Unity 2017.2.0f2, using the 2017.2 dev branch of the Holotoolkit stuff. Can't see the controllers at the start of Unity's play mode, but if I go to the Windows VR house and then return to Unity I can see the controller override models.

    Identical situation in both the Holotoolkit project itself and my Planet Protector VR game project.

  • A trick another user taught me to get the inputs working in editor is to hold the play button in unity, then slide the headset on while still holding the play button , once the app launches it should recognize the inputs, that helped me a lot .

    Unfortunately this does not translate for published builds, I am using the XR namespaces to get input too and it looks like not only is the input not being recognized but when I make a build my buttons aren't even responding to inputs or even onHover interactions and all of ours are built using the basic UGUI stuff.

    Everything works fine in the editor with the play button trick but I am getting no interaction in the build once I publish and launch an .appx file . I feel like whatever the play button trick manages to handle needs to analyzed.

  • The first thing to do is to update to Unity 2017.2f3-MRTP. You can get controller states using the UnityEngine.XR.InputTracking.GetLocalPosition/Rotation.

    If you want to detect them, you can query the number of connected joysticks. Mixed Reality Controller have the name "Spatial" so you can do Something like that to detect them:

    var joys = Input.GetJoystickNames();
    foreach (var joy in joys)
        if (joy.Contains("Spatial"))
            return true;
    

    This is what I use today in production and it works well. Be carefull on one thing. If controllers are deconnected, the Joystick array will contains again to motion controllers... That's bug :/

    French XR/MR developer / Indie Game Developer

  • Patch 2017.2.1p1 has this in release notes:
    (948931) - XR: Fixed Windows Mixed Reality controllers not being properly detected in Editor Play mode.

    https://unity3d.com/unity/qa/patch-releases

    Taqtile

Sign In or Register to comment.