- Home /
Question by
felix420 · Apr 11, 2012 at 03:35 AM ·
waterfogunderwaterblue
underwater fog script
i cant figure out why no matter what i do it wont come out as the color blue, aqua, or even clear. it always comes out a yellowish
//set your varibles here. var fog = false; var fogColor = Color (0, 0, 1, 1); var fogDensity = 0.04; var skybox : Material; //this is where you go underneath the water or in this case into the trigger aera //this is just the effect not anything to do with force. function OnTriggerEnter(other : Collider) { fog = true; RenderSettings.fog = fog; RenderSettings.fogColor = fogColor; RenderSettings.fogDensity = fogDensity; RenderSettings.skybox = skybox; } //this is where we are exiting the water and the effect of being underneath the water is ended. function OnTriggerExit(){ fog = false; RenderSettings.fog = fog; }
Comment
Have you changed fogColor in the Inspector? The Inspector has elephant memory, and keeps the last value set unless you modify it again in the Inspector while not running (changing the initialization value in the script doesn't work either).
Your answer
Follow this Question
Related Questions
createing a underwater java script ArgumentException: get_fog. 1 Answer
Foggy Water? 1 Answer
Fog On and Off Script Help! 2 Answers
Underwater effect question 2 Answers
Is it possible to use layers with fog? 0 Answers