I’m having problems trying to get a pause menu working on my FPC (First Person Controller), I have a script that enables and disables it when a key is pressed (escape). However, it seems that when i press the key, it doesn’t enable it at the “Start” of the game.
PauseMenuEnabler (Javascript)
var PauseScript1 : PauseMenu;
function Start () {
PauseScript1 = GetComponent("PauseMenu");
PauseScript1.enabled = false;
Screen.lockCursor = true;
}
function Update () {
PauseScript1 = GetComponent("PauseMenu");
if(Input.GetKeyDown("escape")) {
PauseScript1.enabled = true;
}
}