oneshot emitter on collision

Hey guys,
i just purchased particle candy and am enjoying it thus far, seems really cool. I hoped that i could find some help here. What i am trying to do, is make it so when my character collides with an object, then my emitter plays. the issue im finding is that when i create my Emitter, and set the “Loop” variable to false, then when i go to use Particles.StartEmitter(“test”), the emitter does not fire the effect. I am trying to have it just do a oneshot explosion when i trigger it. If i leave the “Loop” variable as true, it is constantly repeating on screen, but will play as well when i trigger it. Can anyone please explain the best way to setup my emitter so it will stay dormant only until i trigger it to play and it will play only once? thanks in advance. [import]uid: 19620 topic_id: 17481 reply_id: 317481[/import]

Hi Marc,
to let an emitter fire once, then stop, just set it’s loop parameter to false when creating it:

[lua]-- CREATE AN EMITTER (NAME, SCREENW, SCREENH, ROTATION, ISVISIBLE, LOOP)
Particles.CreateEmitter(“E1”, screenW*0.5, screenH*0.5, 0, true, FALSE)[/lua]
Then attach one or more particle types to it. Keep in mind, that, as shorter the duration, as higher you have to set the emission rate to produce enough particles within that short amount of time (also consider to use oneshot emission here, which emits all particles within a single moment, not over time).

[lua]-- FEED EMITTER (EM. NAME, PARTICLE TYPE NAME, EMISSION RATE, DURATION, DELAY)
Particles.AttachParticleType(“E1”, “Test1”, 50, 500,0) [/lua]
Then trigger your emitter at any time or at any event. Set the second parameter to true for oneshot emission or false for normal over-time-emission:

[lua]-- TRIGGER THE EMITTERS
Particles.StartEmitter(“E1”, true)[/lua]
This is all. If it still doesn’t work for you, please send us some stripped down code, and we’ll go through it.
[import]uid: 10504 topic_id: 17481 reply_id: 66933[/import]

Thank you, i got it working perfectly, i think i must have had my code mixed up in some way. thanks for the great support! [import]uid: 19620 topic_id: 17481 reply_id: 66985[/import]