I have a problem with the MouseLook script. When i press Esc the pause menu comes up but i cant disable the FPS-MouseLook. I have the JS version of MouseLook. I set the script on Main Camera and FPS Controller. But it says:
.
NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name)
UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name)
MouseDisable.Update () (at Assets/Scripts/MouseDisable.js:6)
.
.
This is the script i wrote, please help?
function Update ()
{
if(Input.GetKeyDown("escape"))
{
GetComponent("MouseLook").enabled = !GetComponent("MouseLook").enabled;
}
}