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.
Options

Some features that work in Unity Engine (runtime) don't work in Hololens

Hi all,
Case 1;
Some UI components like Slider from Unity does not move in HoloLens using Gaze and gesture. (They work just fine in Unity Editor)

Did you face any similar UI related inconsistencies?

Case 2:
I am developing a tool that will download 3D objects at runtime from my web server and show it on HoloLens.

I am making HoloLens and the webserver talk through the REST APIs which is working fine.

The response is a JSON and I am using UnityEngine.JsonUtility to parse it.

JsonUtility is working fine in my Unity Editor, but when I am deploying app on HoloLens, it's returning null.

Usage:
accountDir = JsonUtility.FromJson<DirOrFiles>(wwwDir.downloadHandler.text);
(Class DirOrFiles has one array of string object: contents)
Here accountDir.contents is null and hence my code cannot move forward.

or do you recommend any other JSON parser class?

Thank you in advance.
Arjun

Answers

  • Options

    I've used SimpleJson without issue.

    http://answers.unity3d.com/questions/987666/how-can-i-import-simplejsoncs-to-unity.html

    I haven't had any issues gesture inconsistencies. How are you faking the gesture in the engine?

    Taqtile

  • Options

    Hey @mark_grossnickle
    I will try and use the SimpleJson today. Did you ever try JsonUtility?

    I am using HoloToolkit's input manager for the gestures and I fake it by holding up key and a click, that's like an airtap.

    I was not able to slide the slider. There are certain parts of unity that are triggered for Mouse Events(like hover, button up/down) but they do not trigger for the Gaze/Gesture. (at least for me)

    Arjun

  • Options

    No, I haven't used jsonUtility.

    And now I understand. Mouse interactions don't automatically get ported into Hololens. As far as I know.

    To do the slider you would need to implement the navigation gesture and wire it to the slider.

    Here is a general gestures tutorial:
    https://developer.microsoft.com/en-us/windows/mixed-reality/holograms_211

    Taqtile

  • Options
    edited May 2017

    Arjun,

    Here is an old post around using Unity UI for the HoloLens but it may be beneficial for you:
    https://forum.unity3d.com/threads/unity-ui-on-the-hololens.394629/

    Take a look at the InputManager test site in the HoloToolkit to actually interact with the slider control. I've not tried to work with that particular control. In general, if you can get it to work with the InputManager prefab in the editor by using the hand / air tap it should work for you in the emulator or on the device itself.

    Thanks for being a member over at https://LearnHoloLens.com. I'll also mention to take a look at the Gaze and Gesture master class as I go into detail about the InputManager.

    Regarding JSON -- make sure that you have selected the Internet client capability so the device can actually reach the outside world. It could be that is the real issue.

    Hope that helps,

    Chad

  • Options

    Thank you for the UI help.

    Chad, I have the Internet Client capability selected. The problem is in parsing the JSON that I get from UnityWebRequest. The request is going through.
    accountDir = JsonUtility.FromJson<DirOrFiles>(wwwDir.downloadHandler.text);
    This line of code is returning NULL into the variable accoundDir when ran in HoloLens emulator or on HoloLens.

    It works just fine in Unity, Am I missing something that needs to be done in VS?

  • Options

    For Unity projects you need to have things in the plugins folder for it to work. So grab the the nuget package from a regular project (like a console project) and then copy the dll into the /Assets/plugins folder in Unity. Then you should have access to it.

    Here is some more info with different tips from others if that doesn't solve your problem:
    http://stackoverflow.com/questions/30398407/adding-json-net-to-a-unity3d-project

Sign In or Register to comment.