Turn a particle emitter on/off?

I am using a particle system as a weapon for in my game, the particles have a local z velocity and I just aim the object the system is attached to. I want to have the particles emit only when I hold down the Fire1 button. Here is the script I have been trying to use, but, when I release the button, all of the particles in the scene stop moving. While that is a cool effect, it doesnt make for very good gameplay :). How can I make the particle emmitter stop, but have the existing particles remain unaffected? Thanks

function Update (){
       if(Input.GetButton( "Fire1" )){
            particleEmitter.enabled = true;
  }
      if(Input.GetButtonUp( "Fire1" )){
            particleEmitter.enabled = false;
  }
}

Try particleEmitter.emit = true;

Thanks :slight_smile: