Trigger works but not the way i want it to

hey guys my trigger works i have tested my trigger and it is triggering But i fist add this script on my trigger.

 function OnTriggerEnter (other : Collider) {
Destroy(other.gameObject);
}

that works than i changed it to.

 function OnTriggerEnter (other : Collider) {
animation.Play("aimout");
}

that works also but i want the animation to triggerd on a other object object Doors. so think the script shoud look like this.

    function OnTriggerEnter (other : Collider) {
(Find.Object("Doors");
animation.Play("aimout");
}

But as i alreddy expected it wil not work so does some one know how to fix this.???thanks

Wesley S

I guess you created a boxcollider in front of a door that you use as trigger. That have been done by a lot of people already. The easiest way to "say" your trigger script what it should trigger.

var triggerTarget : GameObject;

function OnTriggerEnter (other : Collider) {
    triggerTarget.animation.Play("aimout");
}

That's the basic idea of Unity. Just drag your "Door-object" onto the triggerTarget variable in the inspector.