Fade texture on collision/trigger with certain tag or layer?

We’re developing a storm system and we have a two cylindrical layer systems that handle the rain and mist effects. We need them to fade on collision or trigger when entering a certain layer or tag (a house or inside area) then fade back in when out of the trigger area, but the collision can’t interfere with the players motion. It has to just act as just a trigger.

Is there anyway to do this? If you guys could help us out that’d be great thanks.

Something like this which doesn’t seem to work? And doesn’t handle tags so we’re not really sure how to go about this…

var glowColor : Color = Color.grey;
private var dot : float = 0.5f;

function Update () {

if (collider.isTrigger == true)
    renderer.sharedMaterial.SetColor ("_TintColor",  glowColor * dot);
}

I’m not sure if I understood exactly what you want to do. If you have rain and mist generators attached to the player, and want to fade them when the player enters some selected volumes, you can use something like this (player script):

var inTrigger: int = 0; // is > 0 when inside any "FadeArea" trigger
var rain: GameObject; // rain generator
var mist: GameObject; // mist generator

function OnTriggerEnter(other: Collider){
  if (other.tag == "FadeArea"){ // if entering a FadeArea trigger...
    inTrigger++; // increment the inTrigger counter
  }
}

function OnTriggerExit(other: Collider){
  if (other.tag == "FadeArea"){ // if leaving a FadeArea trigger...
    inTrigger--; // decrement the inTrigger counter
  }
}

function Update () {
  var fade: float =  1.0; // fade factor: is 1.0 for normal color...
  if (inTrigger > 0) fade = dot; // and "dot" when faded
  rain.renderer.sharedMaterial.SetColor ("_TintColor",  glowColor * fade);
  mist.renderer.sharedMaterial.SetColor ("_TintColor",  glowColor * fade);
}

This script will fade the color whenever the player enters a trigger tagged “FadeArea”. A counter is used to handle overlapping triggers: inTrigger is zero only when the object is outside all “FadeArea” triggers.

I believe you are looking for this : http://unity3d.com/support/documentation/ScriptReference/Collider.OnTriggerEnter.html