I’m assigning several components to a camera at runtime. When I enable that camera, it’s a blank white screen. But If I have the camera selected in the scene when I enable it, it renders fine. Is there a way to refresh the camera? What am I doing wrong? Thanks.
Also, how would I cast the gameobject to a camera type so I can modify camera specific settings too. I can only add a component to a GameObject type, so i needed to use an array of gameobjects. Would I add my components then cast it to a camera then update those settings? Thanks again.
public GameObject[] cameras;
void Awake()
{
AssignComponents();
}
void AssignComponents()
{
foreach(GameObject cam in cameras)
{
cam.AddComponent("ColorCorrectionCurves");
cam.AddComponent("FastBloom");
cam.AddComponent("CameraSettings");
}
}