Changing fog and camera background color with script

Hi everyone. I have this script that I found here day/night cycle. I was wondering, how do I make the color of the fog and camera background color change to suit the brightness of the light? Thanks for any input.

1 Answer

1

Use RenderSettings for fog and Camera.backgroundColor for the color.

Can you give an example of this in a script, because I'm not really sure how I should use it.

Examples are in the documentation, but for example changing the fog: RenderSettings.fogColor = Color.blue; RenderSettings.fog = true; For camera settings you need a reference to your camera, then use: camera.backgroundColor = Color.red; Good luck!