Search Unity

Make Menu Appear when user lowers Head

Discussion in 'AR/VR (XR) Discussion' started by eagamedev, Oct 1, 2016.

  1. eagamedev

    eagamedev

    Joined:
    Jun 23, 2016
    Posts:
    14
    Hello.

    I'm building a VR app for android devices.
    I'm using google VR and unity 5.3.3.

    I need to make a small menu appear in front of the camera, when the user lowers his head. But i'm facing some problems.

    The first one:

    I managed to make it apper in front of the camera like this:

    if (!menuOn) {
    MenuUI.transform.position = camaraH.transform.position + camaraH.transform.forward * distance;
    MenuUI.transform.rotation = new Quaternion( 0.0f, cameraH.transform.rotation.y, 0.0f, cameraH.transform.rotation.w );
    menuAnim.SetTrigger("Show");
    menuOn = true;
    }

    But for some reason i cant make it always appear in the same spot related to the screen.
    I want it always at something like 30degrees down the normal head position.


    Second Problem:

    I want the menu to move if the user rotates his head to either side. Just make the menu follow in the same line.

    I hope i made clear what i need! :S

    It seems like it's something really easy to do but i can't make it work!

    Thank you.

    Ez.
     
  2. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    See if this helps:
     
  3. robrtoprz

    robrtoprz

    Joined:
    May 15, 2017
    Posts:
    9
    I'm trying to find how to do this too, does any one know?