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.

Detecting Motion Controllers in Unity

Hi all,

I'm having trouble detecting the Microsoft Motion Controllers in a Unity scene. I'm using Unity 2017.2b9 with Windows OS Build 16257.1, with the HP Mixed Reality Headset. I check for Motion Controller firmware updates at the beginning of every development period and confirm that they are working with the Windows Mixed Reality Portal before moving on to Unity.

Currently I have an default test scene with a Main Camera controlled by a Mixed Reality headset, a textured cube, and a GameObject with a script using Windows-Specific APIs in accordance to this tutorial. Right now the script just polls for the interaction sources each frame, with an Update() method containing:
var interactionSourceStates = InteractionManager.GetCurrentReading();
Debug.Log("Num Interaction Source States: " + interactionSourceStates.Length);

This debug statement is returning length 0. I've also attempted to use the InteractionManager input events using the example presented in the Motion Controller tutorial, with no success at detection. The headset works and I can see the textured cube. Once I hit the Windows button on the controllers while in Unity and return to the portal, I can successfully see the Motion Controllers and they work just fine.

Attempting to use the Headset and Controller emulator on the desktop in conjunction with the Unity project just crashes my computer with a runtime error at Program: C:\WINDOWS\system32\dwm.exe.

Anything that could help me get in the right direction?

Thanks,
Dale

Answers

  • Hello,

    I don't have controllers yet but that's what I use with the simulator to detect them.

    French XR/MR developer / Indie Game Developer

  • As an update; I've gotten the simulator to work and they are detected in Unity, but I still cannot get the physical controllers to be detected.

  • Using the Acer MR, in unity Unity 2017.2b8 i managed to get the inputs recognised using
    var interactionSourceStates = InteractionManager.GetCurrentReading();
    if (interactionSourceStates[0].touchpadTouched && interactionSourceStates[0].touchpadPosition.x > 0.5)
    {
    ...
    }
    Unfortunately I cannot get the same result anymore after I updated WIndows version and Unity to 2b9. Anyone encountering similar problems?

  • The only way for me to reliably get controllers in Unity is to put the headset on, open it up so sensor doesn't detect you, press AND HOLD Unity's play button, and close the headset (windows will release all input, start the app and I get controllers in 100% of the time).
    I can't see any controllers, but I'm getting tracking info through.

  • @Pawel, just tried that out and it seems to work for me. It's definitely a short term solution, but I'll just work with this until there's a more permanent method of getting controller detection.

  • @Pawel I dont know how you have figured this one out, but genius! Works for me too :smile: Thank you for sharing!

Sign In or Register to comment.