Shooting (Particle effects) from player...

Hey, So I did some of my project, but it's still not fully working. I'm trying to shoot a particle system from the player... It works, like, it shoots and has force to it etc. etc. But when I shoot, it just keeps on spawning and destroying. So, I turn on auto-destruct, but even that doesn't work because then it destroys the original prefab (I put the particles in a prefab)...

Anyways, here's my code:

var newObject : Transform;

function Update () {

    if (Input.GetButtonDown ("Fire1"))
    {
        Instantiate(newObject, transform.position, transform.rotation);
        animation.CrossFade("Take 001");
    }
}

If you have any ideas, please post. Thank you so much, Justin W.

I think your auto-destruct might be wrong because it shouldn't be destroying your prefab, but without seeing your usage, it's hard to say.

Typically for something like this, you wouldn't need to Instantiate and Destroy your emitter all the time like this. You'd create an emitter attached to the thing you want to emit and you would use `particleEmitter.emit = false;` or `particleEmitter.emit = true;` to enable disable emission or you could even specify that the emitter should emit and how much with `particleEmitter.Emit();` You could even enable/disable the emitter itself as appropriate to cut down on its memory footprint.