- Home /
Question by
Red Sentinel · Apr 20, 2013 at 10:27 PM ·
cameracolorfog
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.
Comment
Best Answer
Answer by GerryM · Apr 20, 2013 at 10:48 PM
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!