Search Unity

SuperHot VR Style Menu?

Discussion in 'Editor & General Support' started by thehyatkyatt, Jan 14, 2020.

  1. thehyatkyatt

    thehyatkyatt

    Joined:
    Jan 14, 2020
    Posts:
    1
    I am new to unity and learned some things. In my game I want my main menu to be on a computer. So you can look around the room but select things on the computer. You would be using the arrow keys to select. Any help would be appreciated. Thanks!
     
  2. mcmount

    mcmount

    Joined:
    Nov 15, 2015
    Posts:
    83
    I would create the monitor screen as a still image or video (texture). Each menubutton would be own plane with own material & texture. I would create the normal button image and hilight button image (indicating which item you are about to select). Menuitems could be assigned codewise as a list. Then just code (not tested, out from the hat);

    Public Material[] menumat;
    Public Texture2D[] normal;
    Public Texture2D[] hilight;
    Private int i=0;

    Then update;

    if (Input.GetKeyDown("right"))
    {
    i++;
    menumat.mainTexture=hilight;
    menumat[i-1].mainTexture=normal[i-1];
    }

    ....etc...

    This lacks the up and down, you would need to calculute which index you are hopping to depending on the menuitem count. Also end cycle needs to be checked. Pressing enter would then use the variable i as your selection.