Destroy object in time

Hello!
I want destroy object after 5 sec.
Script:

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

It work, but it don’t wait to destroy..
Please help!

I think that you just need to put this code before the destroy code line

“yield WailtForSeconds(5.0);”

No need for that, just do “Destroy (other.gameObject, 5.0);”. (You know, it’s really a good idea to read the docs, they explain all sorts of things like this.)

–Eric

Thanks!