Particle system does not re-emit until Start Lifetime elapsed

Hi,

I am using the particle system to create a gun emission effect that should occur as soon as the player presses fire.
In the Update function the particle system is started when the player presses fire and stopped/cleared when they aren’t pressing it - even if I place the stop/clear code prior to emitting, the system refuses to emit particles until the Start Lifetime timer has elapsed.
Obviously this is not the desired behaviour as the emission is then intermittent and not immediate.

I have tried setting max particles to a high value and emission rate to a low value + several other tests but I am becoming convinced the particle system ignores any attempt to re-emit (even after clearing etc) until the Start Lifetime has elapsed since the last emission.

Any ideas what I can do to remedy this?

Thanks.

I would instantiate the particle system on ButtonDown and destroy it on ButtonUp, instead of controlling the emission rate.

Would this not cause undue garbage collection?
I’ve mostly written mobile games over the last few years and creating/destroying objects at runtime is something I’ve learned to avoid like the plague.

Also I’m not attempting to dynamically control the emission rate as such, simply stopping and clearing/restarting the system, which intuitively I would have thought would do the job.

Ok this text may appear several times as it’s the 3rd time I’ve posted a reply in the hope it will appear sometime!

Anyway, won’t your suggestion cause unnecessary garbage collection?
I’ve mostly worked with mobile platforms and I know to avoid creating/destroying objects at runtime like the plague.

Also I’m not trying to dynamically control emission but simply stopping, clearing/restarting the emitter which, intuitively, I would expect to just work.

Thanks.

I’ve managed to solve this )) it was my faulty understanding (I’m new to unity).
I unchecked Looping, changed duration to 1.00 and reduce the Start Lifetime, then used particlesystem.Emit(1) in Update to emit a particle per frame while the fire button is held.
Works nicely but I suspect the 1 may need to be made framerate-independent somehow.