Multiple cameras and one script problem...

Hello everyone. I am having this weird issue. I have a few cameras in my scene and each has the same script that uses this.gameObject to move the camera around (its attached to camera) and when switching to a camera that hasn’t been switch to, everything is good. But when switch back the first camera the script thinks the this.gameObject is the previous camera object.

For example:

User is on camera 1 —> User changes camera and is now camera 2 —> Users goes back to camera 1 but the script thinks that camera 2 that is now disabled is still “this.gameObject” in the script when it’s suppose to be camera 1 that’s enabled and user can not move camera 1 anymore.

I’m not sure how to fix. Been stumped for a few days. Any help will be good. Thanks in advance!
Here is the code for switching cameras:

    public void Cameras(string message)
 {
	cameras[(int)currentCamera].SetActive(false);

	currentCamera = (int)float.Parse(message);

	cameras[(int)currentCamera].SetActive(true);
}	 

Here is the code for moving cameras:

void Update(){
        if(whichWay == 0)
		{
        // this.gameObject should change from camera 1 to camera 2 and back again when switching
        // but it doesn't...
			this.gameObject.transform.position = 
				Vector3.Slerp(this.gameObject.transform.position, 
				way[currentNode].transform.position,
				camSpeed*Time.deltaTime);
			
			if(Vector3.Distance(this.gameObject.transform.position, 
				way[currentNode].transform.position) < 0.01f)
			{
				check = 1;
				whichWay = 5;
			}
		}	
		else if(whichWay == 1)
		{
			this.gameObject.transform.position = 
				Vector3.Slerp(this.gameObject.transform.position, 
				way[currentNode].transform.position,
				camSpeed*Time.deltaTime);
			
			if(Vector3.Distance(this.gameObject.transform.position, 
				way[currentNode].transform.position ) < 0.01f)
			{
				check = 1;
				whichWay = 5;
			}
		}	
}

this.gameObject will never change it’s value, it will always point to the gameObject the script is attached to, regardless of whether it is active or if there are multiple objects with the same script.

I think the problem is that you’re assigning whichWay the value of 5 in a couple places, but your script will only run if whichWay == 0 or 1. Perhaps you should reset it’s value OnEnable or something of the sort. That’s considering 5 was the intended value, of course.

private void OnEnable()
    {
        whichWay = 0;
    }

It was a singleton that I used that made the script refer to only one camera and spread it’s values to the other cameras. Basically everytime I changed cameras, I hijack the script and it’s values from the previous camera.