Destroying another object through a collision?

Hello. When Object A collides with object B, how can I send a message from a script attached to object A to destroy object B. I have tried this, but it does not work(I am not getting any error messages):

function OnTriggerEnter(other : Collider){

Yes, I know it would be easier to handle destroying object B in a script attached to object B, but I have a reason for doing it this way.


It should work fine. Just make sure you have one of the object’s collider’s set to “isTrigger”