I was wondering if there wan an easy way to make fog appear only on one part of my level… I’m not much of a scripter so you’ll have to be patient with me. THANKS
you could simply add a :
RenderSettings.fog = true;
when the player gets to the spot where they see the fog.
A simple way would be to have something set on the floor as a rigidbody.
throw the following script onto the character controller. and set the variable to that rigidbody
var trig : Rigidbody;
function OnControllerColliderHit (hit : ControllerColliderHit) {
if(trig==hit.collider.attachedRigidbody){
RenderSettings.fog = true;
}
else{
RenderSettings.fog = false;
}
}
doing it that way, the fog turns on when they step or touch the trigger object, and it turns off when they get off.
I don’t think it’s very efficient, but it should work.
Rigidbody is not really the right thing to use as a trigger (They are for physics interactions). A regular collider set up where you want to show or hide the fog is what you want. Then your collider script will use an onColliderEnter /exit event handler to turn the fog on and off:
http://unity3d.com/support/documentation/ScriptReference/Collider.OnCollisionEnter.html
simple as it sounds… just use particles! I think theres a way to make fog, or even dust (as is given in the standard assets in unity 3.0), just play around with it and see where it takes you.
Ok, thanks for the answers everybody. I’m sure one of them will work.