I am making a GUI mobile phone for my game, and I am having trouble getting it to work. It does not close. Here is my code:
var onoff : boolean;
var testObject : GameObject;
function Update () {
if (Input.GetKeyDown(KeyCode.P)&&onoff == true)
testObject.active = false; onoff = false;
if (Input.GetKeyDown(KeyCode.P)&&onoff == false)
testObject.active = true; onoff = true;
}