x


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.

more ▼

asked Oct 31 '10 at 02:34 PM

dingben gravatar image

dingben
359 26 30 41

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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

more ▼

answered Nov 18 '10 at 03:03 AM

fireDude67 gravatar image

fireDude67
945 9 15 30

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.

Nov 19 '10 at 11:59 AM dingben

changed it around a lot..

Nov 19 '10 at 03:43 PM fireDude67
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x320
x89
x49
x25

asked: Oct 31 '10 at 02:34 PM

Seen: 2293 times

Last Updated: Oct 31 '10 at 02:34 PM