x


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;
    }
more ▼

asked Apr 11 '12 at 03:35 AM

felix420 gravatar image

felix420
0 2 3 4

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).

Apr 11 '12 at 04:02 AM aldonaletto
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first
more ▼

answered Apr 11 '12 at 09:47 AM

eaglemaster7 gravatar image

eaglemaster7
28 5 6 10

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3324
x300
x86
x47
x19

asked: Apr 11 '12 at 03:35 AM

Seen: 970 times

Last Updated: Apr 11 '12 at 09:47 AM