The new particle system and autodestruct [js]

Hello, i’ve been looking at forum to solve my problem, but nothings helps.

The old particle system has got an autodestruct option, but now - the techs of Unity Team have replaced the old one with not-fully working Shuriken.

So, I read that to destruct the particle system you must do it manually in script. But I don’t want to destruct it completely. How to make it visible for 4 seconds after mouseclick?

Use a wait for seconds function.

try something like

var isDestroying = false;

function Update() {
   if(!isDestroying  Input.GetMouseButtonUp(0)) { // check flag and mouse click
      Debug.Log("Pressed left click.");
      isDestroying = true; // sets flag so this doesn't get called on repeated clicks
      Destroy(gameObject, 4f);
   }
}

Now I wanna just show the ‘explosion’ effect to show when I click mouse button. That code would work?

If you want the ‘explosion’ effect to show only the first time the mouse is clicked and immediately, then yes. Put the call to whatever shows the explosion inside that if block.

And how to show it back?