- Home /
Changing Skybox tint in game, permanently changes it in editor?
Is this a glitch?
I am experimenting with changing the skybox based on ingame events, so I used this line:
if(Input.GetKey (KeyCode.K)) RenderSettings.skybox.SetColor("_Tint", Color.red);
It worked. It changed my skybox to a harsh red tint. But it's permanent. It's now red in the editor.
I can fix it by using Color.grey, but why does the change stay even when the game stops? Shouldn't it reset?
Answer by 2d4Games · Aug 16, 2013 at 11:41 AM
RenderSettings affects stuff in the scene as well, because it changes all of the render settings. If you want something that only changes temporarily, you could make a very large mesh around the entire scene and change the material of that using a script. That way you can still see everything from the inside, and you won't have to mess with the render settings of unity.
Alright, thank you for the info. For the sake of performance, I will not be adding more mesh, I'll just make sure I have exit code to clean up any changes.
Thanks.
Glad I could help. Would you $$anonymous$$d accepting my answer, by the way? I would appreciate it :D