Camera background color don't update when changing it from code
Hello, i have a High-Definition RP project and i'd like to change the camera background color via script. If i change it in the editor it's just fine, but not from code. Background Type is set to color.
If i set the color like this, and then logging it console, it prints that the color is set, but in the game window and in the inspector nothing changes.
public Camera cam;
private void LateUpdate()
{
cam.backgroundColor = Color.black;
Debug.Log(cam.backgroundColor);
//taking a screenshot...
}
Any help is appreciated. Note: its working in "3D" and "3D with extras" projects. Using unity version 2019.1.1f1, did not tried in other versions.
Answer by ttibi92 · May 08, 2019 at 01:43 PM
Figured it out... There is a script called HDAdditionalCameraData attached to the camera. The background color can be changed through this.
Yes... if using HDRP, this additional component will be in the camera and will control the background color. Thanks for your answer!
Your answer
