Hi. I have a newbie question 
How to modify the code below so that when the rocket hits objects with tag “Enemy” it instantiates killExplosion instead of explosion.
var explosion : GameObject;
var killExplosion : GameObject;
function OnCollisionEnter (collision : Collision) {
var contact : ContactPoint = collision.contacts[0];
var rotation = Quaternion.FromToRotation(Vector3.up, contact.normal);
Instantiate (explosion, contact.point, rotation);
}
Thanks.
For future reference, people may be more willing to help if you put forth some effort yourself and not just ask people to do things for you. But this is fairly easy, so I will help you out.
var killExplosion : GameObject;
function OnCollisionEnter (collision : Collision) {
if(collision.gameObject.tag == "Enemy"){
var contact : ContactPoint = collision.contacts[0];
var rotation = Quaternion.FromToRotation(Vector3.up, contact.normal);
Instantiate (killExplosion, contact.point, rotation);
}
}
Oh thanks. I actually did try some stuff like this :

function OnCollisionEnter (collision : Collision) {
var contact : ContactPoint = collision.contacts[0];
var rotation = Quaternion.FromToRotation(Vector3.up, contact.normal);
if (collision = GameObject.FindGameObjectsWithTag("Enemy")) {
Instantiate (killExplosion, contact.point, rotation);
}
else {
Instantiate (explosion, contact.point, rotation);
}
}
Didn’t work 