Question: So I'm just trying to create a simple script in C# which will allow me to switch between two cameras, named Camera1 and Camera2. But I have run into the error UnityEngine.Camera doesn't contain definition for "active". Which I can't seem to figure out at all. I would really appreciate any help I can get so that I can keep working on my project. I will put the code for the cameras below.

```
using UnityEngine;
using System.Collections;

public class CameraSwitching : MonoBehaviour {

public GameObject Camera1;
public GameObject Camera2;

    public void ChangeCamera () {

        if (Camera1.camera.active) {
            Camera2.camera.active = true;
            Camera1.camera.active = false;
        } else if (Camera2.camera.active) {
            Camera1.camera.active = true;
            Camera2.camera.active = false;
        }    
    }    
}

```

Answer: 
Check the current active camera by comparing the gameobject 

```
using UnityEngine;

public class CameraSwitching : MonoBehaviour {
    public GameObject camera1, camera2;

    public void SwitchCamera() {
        if (Camera.current.gameObject == camera1) {
            camera1.SetActive (false);
            camera2.SetActive (true);
        } else if(Camera.current.gameObject == camera2) {
            camera1.SetActive (false);
            camera2.SetActive (true);
        }
    }
}

```
Try accessing it like this

```
 Camera2.camera.gameObject.SetActive(true);
 Camera1.camera.gameObject.SetActive(false);

```

*note*: if you are using Unity 5, directly accessing `active` is deprecated and you should use `SetActive(bool b)` instead.