Particle effect not being destroyed

The AttackFX(Clone) in this picture goes away when the particle is done playing
5139188--508703--upload_2019-11-4_22-13-19.png

But the HitFX (Clone) sticks around after, and I am left with this
5139188--508706--upload_2019-11-4_22-13-49.png

I am calling them both what looks to be the same to me
5139188--508709--upload_2019-11-4_22-14-20.png

I added the yield return null in there thinking I wasn’t returning anything from the coroutine bit that didn’t work either, any idea what I am doing wrong here?

Couldn’t you use a simple script on the instanced Particle object in your scene that checks in it’s Update method if it’s still playing, and if it’s not, call Destroy on this gameobject? You could check isAlive, it should return false when the particles are no longer alive.

So I figure this out, in case anyone happens upon this, I saved the prefab with the game object disabled, as soon as I enabled it, all behaved as expected

1 Like

Make sure you set all child particle systems to destroy as well. A number of effects are made up of multiple particle systems.

Make sure you don’t necro really old threads please.

The 2D forums are not even related to particles btw. I’ve moved it to the scripting forum.