- Home /
Question by
coughin05 · Feb 22, 2015 at 04:20 PM ·
instantiateparticlesdestroyparticle system
Destroying a particle system assigned as an component?
So, I realize there's no "Auto-Destroy" option in the Shuriken particle system editor. I've read a few posts already about using "Destroy(obj,t)" to get rid of the particle system once it's done, but I haven't the foggiest how I'm supposed to incorporate this properly with the way I've got things set up now.
Basically, I'm using one object's script to check whether an asset has been assigned for the variable in the inspector and then to grab that inspector-assigned particle system asset for instantiation. Like this:
var particleSys : Transform;
if (particleSys)
{
Instantiate (particleSys,transform.position,transform.rotation);
}
So how should I destroy the particle system after I've instantiated it this way? I've tried just using "Destroy (particleSys,0.5f);", but that gives me an error.
Thanks in advance.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613184000im_/https://answers.unity.com/themes/thub/images/avi.jpg)