ok im using hit tags and the first one works but the second one just freezes so if i tag the sheep as "Bunny" they burst in to a red paritcal cloud but the sheep dont un less I use the Bunny tag but ....well I need more blood for the sheep! so I want to run a bigger partial explosion.
var particle : GameObject;
var particleSheep : GameObject;
function OnControllerColliderHit( hit: ControllerColliderHit) {
Debug.Log("hit Call");
if(hit.gameObject.tag == "Bunny") {
Debug.Log("Bunny hit");
// create the instance of the prefab
var clonedParticle : GameObject = Instantiate(particle,
transform.position,
transform.rotation);
clonedParticle.particleEmitter.emit = true; // tell it to emit
Destroy(clonedParticle, 4); //destroy the particle in 4 seconds
Destroy(hit.gameObject);
}
else if(hit.gameObject.tag == "Sheep") {
Debug.Log("Sheep hit");
// create the instance of the prefab
var clonedParticleSheep : GameObject = Instantiate(particleSheep,
transform.position,
transform.rotation);
clonedParticleSheep.particleEmitter.emit = true; // tell it to emit
Destroy(clonedParticleSheep, 4);//destroy the particle in 4 seconds
Destroy(hit.gameObject);
}
}