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?
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);
}
}
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.