Destroy hit effect in code instead VS using inspector option?

Hi, I don’t know how recently it was implemented in Unity, but when using particles, I was wondering if the “Stop Action” option in the inspector was doing the same as what we are taught here in code ?

My understanding is that when the particle system has finished whatever it was doing and stops, it will automatically be destroyed, using this and setting it to “Destroy” :

Is my understanding correct ?

And in that case, why would we prefer to use the option to destroy it via code instead of directly from inspector ? Is there something that we need to think about when chosing ?

Thanks :3 !

Hi AssaSquid,

Unfortunately, I do not know either when the Stop Action function has been implemented. You are right that we could use the “Destroy” Stop Action to have the system destroy the object automatically.

Whether it’s fine to use the Stop Action instead of destroying the object via code depends on the case. We might not always want to wait until the particle system has completed its task.

The best would be if you simply test both approaches and opt for the one which solves the problem. If both solve the problem, opt for the one you prefer.


See also:

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms