Can you add an event in a particle system?

Hello.

Is it possible to add an event while a particle system is running?

For example when using the Animator window for animations, there is a button called Add Event which can call a function of scripts that the GameObject contains in a specific given time while its animating.

[21361-add+event.png|21361]

If its not possible, then what other things can i do to achieve it?

But the bottom line is that i want to call a function when my particle system have finished playing.

Thanks in advance

To my knowledge, you can’t set an event in a particle system the same way you can do it with the animation.

However for your specific problem, you could use the function ParticleSystem.IsAlive(); (Unity - Scripting API: ParticleSystem.IsAlive)

IsAlive() returns true when there is particles from the system “alive” in the scene.
If the Particle System is done emitting AND all particles are dead, then IsAlive returns false.

You could use that in a loop to check when your particleSystem is done emitting !

Hope this help !