Non-looping Particle System will not fire more than once

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.

public void drop(){
if(waterDrop != null){
waterDrop.gameObject.SetActive(true);
if (waterDrop.isPlaying) {
waterDrop.Stop();
}
waterDrop.Clear();
waterDrop.time = 0f;
if (!waterDrop.isPlaying) {
waterDrop.Simulate(0.0f, true, true);
waterDrop.Play ();
waterDrop.startLifetime = waterDrop.startLifetime;
waterDrop.enableEmission = true;
ParticleSystem.EmissionModule module = waterDrop.emission;
module.enabled = true;
}
}
}

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().

1 Like

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?

1 Like

The unnecessary stuff is my desperation. It is everything that Google has suggested that I try.

This was a known bug, which Unity has declared fixed.

I tried adding a simple particle system to my scene, and repeatedly called Play() in my code. The particle effect fires only once.

I would use Emit(), but it fires all 200 particles at once, instead of a steady release over a 5 second period.

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.

1 Like

Well if you can create a simple project with the same issue I can take a look.

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.