I’ve spent 3 hours Googling this, now it’s time to post my difficulty here. I’m using Unity 5.4.2.
I’ve created a basic particle system that consists of nothing more than the standard Unity balls that shoot out of an emitter. In my game, this ParticleSystem is intended to fire several times throughout the game, for a duration of 5 seconds. It fires only once. Then, nothing. Here’s my code, which contains every suggested fix that I could find on Google.
As you can see, I’ve set the gameObject active, checked if the particle effect is playing, stopped it, cleared it, set its time to “0”, tried “simulate”, tried the startLifetime trick, enabled the emission (both via the depricated method “enableEmmision” AND the new “emission.enabled” system in use as of 5.3.
I’ve never had this problem. On our project running 5.4.2 literally all we do is call Play() and it restarts and plays again. Unless you want the existing particles to go away there’s no need to call Stop() or Clear().
You are doing a lot of unnecessary stuff.
Why are you setting the time and calling simulate with 0, that will do nothing.
If just call play once then call Emit when you want new particles to spawn. How often does drop get called? It clears the particle system each time so maybe it’s a bug in another part of your scripts?
Calling Play multiple times won’t work, once the system is playing then any further calls are not needed.
That bug was fixed in 5.4.0b19, it won’t be in the version you are using.
Can you share the project?
I wish I could, but it’s over 7GB and I’m not allowed to share it.
As a workaround, I’m instead instantiating/destroying particle systems each time I need it to fire. I hate creating things and prefer to work from object pools, but I can’t get the darn thing to fire more than once… even with Google’s infinite wisdom.
I wish to thank you for responding. It’s neat to see the Unity team in action.
As another workaround you could maybe set it up so that the effect you want to play is a subemitter of a particlesystem that you use just to instantiate that effect multiple times. Disable the renderer of the parent particlesystem, place the emitter and call Emit(1), and if you have set the sub-emitter stuff up correctly, you should be able to easily get the effect you want without instantiating new objects.