- Home /
Trying to create a puff of smoke
I'm trying to create a puff of smoke. How do I emit a certain number of particles per action(button press, mouse click, or collision). Currently I'm trying to cut off the emitter after a certain period of time, but doing this causes the particles to just stick in the air, even though the movement should be coming from the particle animator.
Answer by Loius · Nov 12, 2010 at 06:45 PM
emitter.emit = false;
When I do that, the particles just disappear. I would like for the particles to stay alive and maintain their current velocity.
The particles will stay alive for as long as their energy permits, stopping the emitter will not destroy the particles. If the energy is very small, they might seem to disappear. You can also try enabling "One Shot" on the particle emitter and then use the ParticleEmitter::Emit() call at your desired frequency.
Okay, I guess a better question would be, how do I guarantee that the emitter plays one shot and that's it?
Set the emitter to be one shot, then use emitter.emit = true; yield; emitter.emit = false; and that should do the trick.
Thanks. I guess the particle emitter doesn't return anything when the one shot is completed. $$anonymous$$ight be handy unity guys. To fix my problem I made sure to set the $$anonymous$$ and max emission to the same number and then keep emitter.emit at true until the emitter.particleCount > emitter.$$anonymous$$Emission. If there is a better way, any comments would be appreciated.
Your answer
Follow this Question
Related Questions
Wispy Smoke trouble 0 Answers
Stop particles from dying? 2 Answers
How to do Subway Surfers Jetpack Smoke Effect? 1 Answer
Particle system question 1 Answer
Two Particle Systems 1 Answer