hey, i try to make a little menu that pops up when i press the Escape key. I looked it up in other questions, but some how this is not working!
if(Input.GetKeyDown(KeyCode.Escape)) {
escape = true;
}
else{
escape = false;
}
}
function OnGUI () {
if(escape == true) {
GUI.BeginGroup(Rect(Screen.width / 2 - 550, Screen.height / 2 - 100, 200, 100));
GUI.Box(Rect(0,0,200,100),"PAUSE");
GUI.EndGroup ();
}
}
i know that the var escape is not necassary, but i always think that booleans are a nice way to see if the code is working(u can see if the get changed in the inspector). can u guys help me out?