Disable a script on a gameobject in the game already?

Hi, I may be programming quite odd but I was wondering how exactly I could disable a completely separate script (and enable it back again) on a particular gameobject using C#?

The reason being is because I have a bunch of cameras all that have a FPS camera SCRIPT and I switch between them with a button. When I rotate my mouse it also rotates ALL models that are attached to the camera. I only want the camera moving on the camera I have selected.

Most components have a property called enabled that you can use to turn their main functions on and off. So you just need to get a reference to the script in question and set thatScript.enabled = false.

I have attempted to use GetComponet with the scripts name, but I do not get any functionality to use .disabled or .enabled.

I had to comment out the code because it doesn’t work with .enable, but heres what I got.

            if (activeTurretNumber == 1)
            {

                //Disable the script on the current(last) turret
                turretCameraScript = turretSelectedCamera.GetComponent<SimpleSmoothMouseLook>();
                //  turretCameraScript.disabled


                //activate new turret
                turretSelectedCamera = turretsSelected[0].gameObject.transform.GetChild(0).GetChild(1).GetChild(0).GetChild(1).gameObject;
                turretCameraSelectedController = turretSelectedCamera.GetComponent<Camera>();
                turretCameraSelectedController.enabled = true;
                turretCameraScript = turretSelectedCamera.GetComponent<SimpleSmoothMouseLook>();
                //turretCameraScript.enabled
                mainCamera.enabled = false;
            }

This is the variable I have set at the top of my code : private Component turretCameraScript;

If your variable is declared as being type Component, then it will only let you access stuff that ALL Components have (no matter which component is actually assigned to it at the moment). Since there are some Components that don’t have an “enabled” property, you can’t access it from a Component-type variable.

Try declaring it as a Behaviour instead. (Behaviour is the subtype of Component that is guaranteed to have the “enabled” property.)

Or even just declare it as type SimpleSmoothMouseLook