|
Hi.I made a particle system using Shuriken and a script that emitting the particle when I press a button. How do I erase clone when the particle system finish emitting? Thanks in advance.
(comments are locked)
|
|
If you use Instantiate to create the ParticleSystem when the button is pressed, it will have created a clone in your hierarchy window. You will need to use Destroy to eliminate the clone that was instantiated. One way to do this, would be to attach a script to the gameObject of the ParticleSystem, that does a StartCoroutine in which you will WaitForSeconds (long enough for the Particle to complete), and then Destroy(transform.gameObject);. The script would look something like: This assumes 5 seconds is sufficient for your particlesystem to complete. The script would be attached to your ParticleSystem's gameobject.
(comments are locked)
|
