I have a script that disables my mouselook,
MouseLook = gameObject.GetComponent("MouseLook");
MouseLook.enabled=false;
and I want to add a line in another script, on the same object to re-enable mouselook.
I tried adding
MouseLook = gameObject.GetComponent("MouseLook");
MouseLook.enabled=true;
but I get
An instance of type ‘UnityEngine.Behaviour’ is required to access non static member ‘enabled’.
Where am I going wrong? I’m using an Input.GetKey to disable it on one script and an Input.GetKeyUp to enable it on the other.