I’m wondering could you please have a quick look at this javascript and see if you can see any problems. I have this script working on another project where it is attached to the first person controller but now I have it attached to a camera (that can fly with keyboard and mouse) and it’s not working.
Basically it used Left Control to pause mouselook.
Any Help would be much appreciated!
function Update () {
if (Input.GetKeyUp(KeyCode.LeftControl)) {
var mouseLook = GetComponent.<FlyingMouseLook>();
mouseLook.enabled = !mouseLook.enabled;
}
}
This is the error I keep getting
“NullReferenceException: Object reference not set to an instance of an object
PauseScripts2.Update () (at Assets/PauseScripts2.js:6)”
But also when I changed GetComponent. (); to GetComponent.(); I get this error
“Assets/PauseScripts2.js(4,39): BCE0018: The name ‘ArupMouseLook’ does not denote a valid type (‘not found’).”