I would like to Instantiate a rock prefab to fall from the sky when you enter a trigger, then be destroyed after a few seconds.
I am having trouble getting it to work though. I have made a prefab rock with rigid body. I have made a collider marked as trigger and added this java script.
var rock : GameObject;
function OnTriggerEnter (other : Collider)
{
var clone : GameObject = Instantiate (rock, transform.position, transform.rotation);
Destroy(gameObject);
}