Hi ,I have a question about ParticleSystem on Unity 5.5 or later.
I made a fireworks effect,
It makes a seed particle, and the seed particle makes subemitted particles when the seed particle is killed.
I want to play explosion sound when the seed particle is killed.
Can I Instantiate some audio GameObject when the seed particle is killed?
I realize that this is an old post, but I am struggling with this same issue today.
It would be great if Unity opened up access to the OnDeath and OnBirth callbacks.
BUT if you’re still interested, here’s a really ghetto solution.
Step 1: Give your subemitter a subemitter that emits 1 invisible particle upon birth.
Step 2: Attach a listener to that subemitter that counts the particles.
Step 3: Whenever the particle count > 0 get the particle’s location and do whatever you need with it.
Step 4: Set the particle’s remaining life to 0. It should get cleaned up before the next LateUpdate.
Hacky as heck, but Unity really should give us a better way to do this, and it does seem to work.