Hi,
I need a GUI to display once I press "1" and remain displayed even after I release it. After a certain amount of seconds, of course, the GUI needs to dissapear. So I thought using:
void OnGUI()
{
if (Input.GetButton("1"))
{
GUI.Box(new Rect(0, 480, 150, 90), "Hello GUI!");
}
}
would work but, I get an error telling me that:
UnityException: Input Button 1 is not setup.To change the input settings use: Edit -> Project Settings -> Input
I took the advice, but I don't know where to set the key, "1". The reason why I think I need to do it this way is because the code:
void OnGUI()
{
if (Input.GetKey("1"))
{
GUI.Box(new Rect(0, 480, 150, 90), "Hello GUI!");
}
}
that I used at first, will not continue to stay up when I release the "1" key. I need the GUI to keep displayed for an arbitrary number of seconds. Basically, I am trying to set up an inventory list for the player. When they press "1" on the keyboard, the inventory list will appear, and they can continue to press "1" to traverse the list (within the same GUI).