Hello, I have the default ‘Sparkle Rising’ asset particle to make an in-game item sparkle, but I want it to stop when I do something but start again when I want to. I have tried doing ParticleSystem.Stop and wrote this script
#pragma strict
private var myParticles : ParticleSystem;
function Start()
{
myParticles = GetComponent(ParticleSystem);
}
//myParticles.Stop(); to stop particles, myParticles.Clear(); to erase them
function Update() {
if(ClickChest.selected == true){
myParticles.Stop();
myParticles.Clear();
}
if(ClickChest.selected == false){
myParticles.Play();
}
}
but there is no particle system on this particular particle. I tried adding one, but it did nothing. Is there a way to stop the emitter or something? Thanks.