- Home /
turning particle systems off
could i make an input to turn on particle emitters on then another to turn it off, thanks :D
Answer by DaveA · Feb 13, 2011 at 07:59 PM
If you just need to enable/disable specific ones, you can set the 'active' property on the gameobject containing them, or the 'emit' property on the particle emitter component of the game object.
var pe : ParticleEmitter;
Start() { pe = GameObject.Find("myparticles").GetComponent(ParticleEmitter);
Update() { if (Input.GetKeyDown("e")) pe.emit = false;
i do have an error... it says expected : found = but if i change it more errors appear! :O but cheers for your time :)
That code was just off the top of my head. I'm assu$$anonymous$$g JS not CS. Can you edit your question to post latest code, and error with line number?
Answer by Meltdown · Feb 13, 2011 at 07:45 PM
You can add all your particle emitters to a specific layer in Unity.
Then based on specific input in your update method, such as a specific key being pressed, you can simply disable all the particle emitters.