Well i'm trying to make a menu when the player press Q . and I made the menu as a gameobject and here is my code :
var gg : GameObject;
private var pauseEnabled = false;
function Start(){
pauseEnabled = false;
Time.timeScale = 1;
}
function Update(){
if (Input.GetKeyDown("q"))
{
if (gg.SetActive == true)
{
gg.Setactive(false);
}
else
{
gg.SetActive(true);
}
}
}
↧