- Home /
How to change the color of the screen??
I have a slider and I'd really like to Know how to change, for example the r component of the general color in my game, just like a setting, for example making it all red or black. Thus I think I should use Color.r,g,b,a , but it seems not working. Please, help me !!
GUILayout.BeginHorizontal();
Color.r = GUILayout.HorizontalSlider(red,0.0, 100.0);
GUILayout.EndHorizontal();
Answer by DaveA · Nov 15, 2011 at 05:14 PM
UNTESTED:
Camera.main.backgroundColor.r = GUILayout.HorizontalSlider(Camera.main.backgroundColor.r, 0.0, 100.0);
yes, it works, but it only changes the backhround. Is$$anonymous$$d i'd like to change all the colors
A cheesy way to do it is put a plane over the whole screen (via GUI or in 3D with a camera-facing-and-following script), and change it's color and alpha to make a 'filter' over the 'lens' so to speak. You can use that to fade-to-black, for example, by adjusting that alpha over time.
Answer by Ludiares.du · Nov 15, 2011 at 06:15 PM
I think you want post process effects. If that's what you want, you need Pro version of Unity.
Answer by Lemo76 · Mar 21, 2013 at 11:52 PM
If you want an overlay to the screen, I advise trying out some tinted transparency materials on a plane and attaching that as a children of the camera
Your answer
![](https://koobas.hobune.stream/wayback/20220613043644im_/https://answers.unity.com/themes/thub/images/avi.jpg)