Hmm, not really sure what your code is supposed to be doing, but I think what I would do is **Instantiate** the particle emitter upon something penetrating the **Collider**.
As in:
//The particle Emitter prefab to instantiate
var myParticleEmitr : GameObject;
function OnTriggerEnter (Bullet : Collider) {
if(Bullet.gameObject.tag=="Enemy1"){
var newParticles : GameObject;
newParticles = Instantiate(myParticleEmitr, transform.position, transform.rotation);
}
}
(Sorry, if this isn't what you were after...)
http://unity3d.com/support/documentation/ScriptReference/Object.Instantiate.html
↧