Destroy object on Trigger Enter

Hi all,

I have an object that I want to destroy when a ball enters its collider.
The object is marked as trigger and has a tag named destroy.
The script is attached to the object I want to be destroyed.
The script is not working…what am I missing?
Thanx and Cheers

function OnTriggerEnter (myTrigger : Collider)
{
if(myTrigger.gameObject.tag == “destroy”)
{
Destroy(gameObject);
}
}

You said you’re attaching this script to the object you want to destroy, which has a tag of “destroy” - and yet in the OnTriggerEnter you’re checking for “destroy”? - Either do this, and attach it to the object you want to destroy (make sure you have isTrigger checked on the collider of your object in order for OnTriggerEnter to fire):

function OnTriggerEnter(other : Collider)
{
  if (other.gameObject.tag == "ball")
     Destroy(gameObject);
}

Or attach this to the ball instead:

function OnTriggerEnter(other : Collider)
{
  if (other.gameObject.tag == "destroy")
     Destroy(other.gameObject);
}

done