- Home /
Change skybox tint in code
I'm having a hard time changing the skybox tint in code. I am using the following line:
RenderSetting.skybox.SetColor("_Tint", Color.red);
I just have this in the Start() function, yet when I run my code, the skybox does not change, I have a custom skybox material which is set in the Lighting tab.
Can anyone help me out here please?
capture.png
(42.5 kB)
Comment
Best Answer
Answer by Jessespike · Sep 08, 2016 at 07:22 AM
The skybox shaders don't use the same property names. If using the Procedural shader, then it's _SkyTint. Can try something like this:
if (RenderSettings.skybox.HasProperty("_Tint"))
RenderSettings.skybox.SetColor("_Tint", Color.red);
else if (RenderSettings.skybox.HasProperty("_SkyTint"))
RenderSettings.skybox.SetColor("_SkyTint", Color.red);
Your answer
![](https://koobas.hobune.stream/wayback/20220612092354im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Color tint on a shader. 1 Answer
How to change the color of the skybox 1 Answer
Skybox Discoloration Problem 0 Answers
Separate Glow Tints? 0 Answers