Disable a script?

This is probably really easy and that’s why I couldn’t find anything with the search function… Sorry.

How would I go about disabling a script attached to a gameobject? Namely, the script called “MouseLook”?

Thanks for any help!

well you first need to catch a reference to your game object and so your script in it

considering that you get your gameobject ref where your script is

just do something like this in C# assuming that myGameObject is the GO where you have mouse look

myGameObject.GetComponent<MouseLook>().enabled = false;

if you are using that in an update then you better cache the MouseLook component in a start fct

hope this help

Yes! Thank you! That did indeed work!

Thank you very much for the assistance