Collision script

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

Inside OnCollisionEnter function, you can use collision variable. It contains the information about the collision happened.

Refer to :

You could easily locate the object collided with by collision.gameObject. Then you can call functions of that object by