Display 1 No Cameras Rendering

I have searched for an answer for my problem, but can’t seem to find one. I have a script so that when I press a button it switches to a different camera, but when it tries to switch to my second camera, it gives me the message ‘Display 1 No Cameras Rendering’. I have tried many different methods to fix this, and nothing has worked.

This is my script:

{
public GameObject camera1;
public GameObject camera2;

public void EnableCamera1()
{
    camera1.SetActive(true);
    camera2.SetActive(false);
}
public void EnableCamera2()
{
    camera1.SetActive(false);
    camera2.SetActive(true);
}

}
Thanks in advance

Looks like the error is thrown because when you call “EnableCamera2” you don’t have any camera rendering since you disable the first one first.

One thing you could try is switching the order in “EnableCamera2” but keep in mind, for a short time you will have 2 cameras active which could throw an error telling you that 2 audio listeners are active at once.

But i would give it a try.

 public void EnableCamera2()
 {
     camera2.SetActive(true);
     camera1.SetActive(false);
 }

I fixed it. Turns out I had an old conflicting script, so I modified both scripts and ended up fixing it.