I've made a Pause menu for my mini game, but for some reason when i hit escape for the first time, the camera wont stop moving.Its only after i go back into the game and press it again that it works. I'm using a Free camera from the assets store but i also get this problem when using the FPS Controller.
I'm using:
canvas.gameObject.SetActive(true);
Time.timeScale = 0;
Player.GetComponent().enabled = false;
Cursor.visible = true;
Screen.lockCursor = false;
}
else
{
canvas.gameObject.SetActive(false);
Time.timeScale = 1;
Player.GetComponent().enabled = true;
Cursor.visible = false;
Screen.lockCursor = true;
I've also tried using cursor.lockstate but that doesn't work either.
As far as i can tell there are no conflicting scripts either.
Any help would be greatly appreciated!.
↧