I am trying to disable mouse look on ‘q’.
Here is my code as is.
#pragma strict
//Variables
public var paused = false;;
//This script is on the main camera
function Start () {
}
function Update () {
if(Input.GetKeyDown("q")){
paused = !paused;
}
if(paused){
//Toggle caputred cursor
Screen.lockCursor = false;
//disable mouselook
//This needs to be changed to disable the FPS controllers script
GetComponent(MouseLook).enabled = false;
//This should kill the cameras script
Camera.mainCamera.GetComponent(MouseLook).enabled = false;
Time.timeScale = 0;
}
if(!paused){
Screen.lockCursor = true;
GetComponent(MouseLook).enabled = true;
Camera.mainCamera.GetComponent(MouseLook).enabled = true;
Time.timeScale = 1;
}
}
The issue is that it only disables it on one axis (e.g cameras axis or players axis ).
So how do i disable both scripts and re-enable both scripts on the generic First Person Controller?
-Grefuntor