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.

Menu for Hololens app

Can somebody explain me how to add a menu in a hololens app with buttons which will redirect to different scenes that i have created in Unity. Plesase help me out. I have been trying to solve this for past 2 days.

Best Answer

  • james_ashleyjames_ashley ✭✭✭✭
    Answer ✓

    @bharath09vadde,

    You may need to add some colliders if you are just using a canvas to build your menu. If the gaze goes through your object, a missing collider is the most likely reason. I'd suggest looking at the interaction example in the MRTK anyways, though. I think the UX is slightly better there for HoloLens than just using a regular Unity menu build.

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

Answers

  • @bharath09vadde ,

    Are you stuck on building interactive buttons or with switching scenes?

    The HoloToolkit-Examples package (2017.1.1) has several interactive examples with menus and buttons you can copy: InteractiveElements/Scenes/InteractiveButtonComponents.

    Make sure you are building all the scenes you need into the app and use SceneManager.LoadScene to switch between scenes: https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.html

    James

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

  • @james_ashley Thanks for your answer, But i my cusor is not been able to see the buttons. It's just projecting through the buttons but not on the buttons. May be the whole canvas thing might have gone wrong.

  • @james_ashley Iam creating an app where ther will be a language selection menu on the first scene. Depending on the language selected the respective scenes should be loaded. For unity its working so gud. iam very new to this Hololens. So Iam facing some problems with the cursor and stuff.

  • james_ashleyjames_ashley ✭✭✭✭
    Answer ✓

    @bharath09vadde,

    You may need to add some colliders if you are just using a canvas to build your menu. If the gaze goes through your object, a missing collider is the most likely reason. I'd suggest looking at the interaction example in the MRTK anyways, though. I think the UX is slightly better there for HoloLens than just using a regular Unity menu build.

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

  • @james_ashley can you please tell me the script that helps to get in to a scene when i select one of the language buttons!! Anyway that collider thing worked for me and thank you so much for helping me out. please help me out of this thing too please

  • @james_ashley Anyway I am using this script, But its not working fine for me in hololens. In unity its working but in hololens its not changing the scenes

    using UnityEngine;
    using UnityEngine.SceneManagement;
    using UnityEngine.UI;

    public class menu : MonoBehaviour
    {

    public Button deutsch;
    public Button english;
    
    // Use this for initialization
    void Start()
    {
    
        deutsch = deutsch.GetComponent<Button>();
        english = english.GetComponent<Button>();
    
    }
    
    public void deutschselect()
    {
        SceneManager.LoadScene(2);
    }
    public void englishselect()
    {
        SceneManager.LoadScene(4);
    }
    

    }

  • @bharath09vadde ,

    Your code looks fine. Are all the scenes selected when you build (0-4)? Is the button event handler actually getting hit when you select it? (You can try debugging your app remotely and putting a break in the handler to make sure.)

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

  • @bharath09vadde
    That looks realy nice - are the flag 3d models available somewhere in the asset store? I'm just asking because I need to implement a language switcher in my application.. :)

  • @bharath09vadde said:
    @james_ashley Thanks for your answer, But i my cusor is not been able to see the buttons. It's just projecting through the buttons but not on the buttons. May be the whole canvas thing might have gone wrong.

    In the inspector of your Canvas, have you change the render mode to "world space"?

Sign In or Register to comment.