I have updated my Unity to 3.5, and unfortunately I never got used to the new Particle System, that I can’t find the “Auto Destruction” option…
can anyone tell me how to destroy a particle when it finished playing? Thanks!
I have updated my Unity to 3.5, and unfortunately I never got used to the new Particle System, that I can’t find the “Auto Destruction” option…
can anyone tell me how to destroy a particle when it finished playing? Thanks!
Add a script to the Particlesystem and in that script alter the Update function
so that it looks like this
function Update ()
{
if (!particleSystem.IsAlive()) Destroy (gameObject);
}
Unfortunately new particle system don’t have auto destruction but if you close looping,your particle becomes disable. maybe this can help you.
if you want to destroy previous example is enough
but if you want to reuse it again and again without creating clone object then you don’t need to Instantiate or destroy it just play it, where and when you want
1.unchecked looping from particle system editor 2.create a transform variable in your script as public(example explosionTrans)and set your particle object from editor. 3.now in your update method
explosionTrans.particleSystem.transform.position=this.transform.position; explosionTrans.particleSystem.Play();
particle object will follow your game object position which is assign by you this script
I have come across the similar problem before, this is how I solved it. In particle system you have created, check whether you have Particle Animator
component install into the particle system, if not it is accessible through Component
> Effects
> Legacy Particles
, you should see the autodestruct option rigth inside this component.