Pause Menu Display
i have got the pause state working i just need the text boxes to appear when "p" is pressed also disables mouse input
pragma strict
ar Paused: boolean = false; var text : Text; //var PlayerController:GameObject;
//function start(){ // //} //
function Update() { if (Input.GetKeyDown(KeyCode.P)) { Debug.Log("Run if pressed");
if (Paused == false)
{
//PlayerController.enabled = false;
Time.timeScale = 0;
Paused = true;
}
else if (Paused == true)
//PlayerController.gameObject.enabled = true;
{
Time.timeScale = 1;
Paused = false;
}
}
}
Answer by romatallinn · Oct 28, 2016 at 10:46 PM
Regarding the text boxes... Firstly, you have to set up the component Text to be disabled by default (component, but not the object). Afterwards, you check, if the game is paused, then enable this text box ui by text.enabled = true;
What does it mean "disables mouse input"? Do you want to disable mouse events? You cannot just completely disable the mouse event system. However, you can check at the place where you use mouse events if the game is NOT paused. If it is NOT paused, then use mouse events. If it IS paused, then ignore them.
yes its to stop any input while the game and the GUI is fine now Thanks
@Dobska could you please accept the answer if it helped you? :)