How can I send a message to the object, that the object with this script, collided with?
var explosion : GameObject;
function OnCollisionEnter (collision : Collision)
{
// Instantiate explosion
Instantiate (explosion, transform.position, transform.rotation);
// Stop emitting particles in any children
var emitter : ParticleEmitter= GetComponentInChildren(ParticleEmitter);
if (emitter)
{
emitter.emit = false;
}
// Destroy the probe
Destroy(gameObject);
}