what i am trying to do is emit a particle on trigger collision with the parent object and disable it on trigger exit.
i have a script that i wrote:
function Start ( )
{
var child = transform.GetChild(0);
child.particleEmitter.enabled = false;
}
function OnTriggerStay(trigger : Collider) {
if(trigger.gameObject.tag == "Water"){
var child = transform.GetChild(0);
child.particleEmitter.enabled = true;
}
}
this by it’s self does not work and i am unsure on how to implement exit trigger.
any help/ amendments would be great
thanks