Question by
suzannepawelek · May 28, 2017 at 03:14 PM ·
cameraguicamera-movementlock-cursorlockcursor
Camera Lock on GUI
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<FirstPersonController>().enabled = false;
Cursor.visible = true;
Screen.lockCursor = false;
}
else
{
canvas.gameObject.SetActive(false);
Time.timeScale = 1;
Player.GetComponent<FirstPersonController>().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!.
Comment
Your answer
Follow this Question
Related Questions
Switching Cameras, Movement not working. 1 Answer
Clip to Gameplay Transition (Cinemachine) 0 Answers
SmoothCameraCrouch 2 Answers
How to make an object go the direction it is facing? 0 Answers
Mouse click not registered correctly using CRT shader 0 Answers