- Home /
Particle Emitter Toggle ON/OFF
As posted in the forums: [ http://forum.unity3d.com/threads/65273-Toggle-Particle-Emitter-ON-OFF ][1]
I would like that someone take a look at that post, and try to answer my question about the 'emit' property/variable in the ParticleEmitter class.
The question is: How is the 'emit' variable used, what effect can be arrived at using it? As you will see in the post mentioned above, I was not able to get results using 'emit' but was successful while using renderer.enable/disable.
Answer by fireDude67 · Nov 18, 2010 at 03:03 AM
I think your script should be something like the following:
var particleEmitterObject : GameObject;
function Start() { particleEmitterObject.particleEmitter.emit = !particleEmitterObject.particleEmitter.emit }
Edit: I have changed the code so that you should drop the GameObject with the particleEmitter on it so that you can access the particle emitter using the GameObject.particleEmitter
accessory
fire... the property is in scope in my script as the Emitter is instantiated immediately before the toggle code. I don't think puting the instantiation in the Start() would help...may actually burn memory longer than the way I declare it. The only difference I see in your code is the using of the NOT operator, '!' versus my assignment to 'true' or 'false', and those are equivalent.