Underwater View

I have looked online and i couldn’t find anysolutions to my problem. I have made a script and a skybox that should turn on when entering a trigger. There is a box, that when entered should act as a trigger, but it doesn’t.

JavaScript Code:
var fog = true;

var fogColor = Color (0, 0.4, 0.7, 0.6);

var fogDensity = 10;

var skybox : Material;

function OnTriggerEnter(other : Collider) {

fog = true;

RenderSettings.fog = fog;

RenderSettings.fogColor = fogColor;

RenderSettings.fogDensity = fogDensity;

RenderSettings.skybox = skybox;

}

the trigger is just set below the pre-rendered water that comes with Unity Free

Please help, it is for a project

thanks

  • Jordan

http://wiki.unity3d.com/index.php?title=Underwater_Script