particle emitter on/off using the left mouse button

how do i make a particle emitter turn on when you hold the left mouse button down and off when you let go?

1 Answer

1

probably something like this:

var someParticleEmitter : ParticleEmitter;

function Update () {
     if(Input.GetKey("Mouse 0")){
          someParticleEmitter.emit = true;
     }
     else{someParticleEmitter.emit = false}
}

hope this helps!

haha thats ok! just add it to any object in your scene(i would use a empty object) to add a empty object click gameObject/create empty then drag the particleEmitter you want to turn on and off on the the empty someParticleEmitter slot...