- Home /
Particles emitting after 10 seconds
I am really new to scripting, so I don't really know what to do. I have my fire and explosions and smoke all placed in my scene, but I want them to emit after 10 seconds. How would I do this?
I don't know scripting, so I'm looking for more of a step by step, and what to write sort of thing.
Thanks :)
Answer by Ben Ezard · Jan 01, 2013 at 12:31 PM
If you're using the new Shuriken particle systems, you'll see a variable called "Start Delay" on the component - just set this to 10, and the particle system will automatically activate after 10 seconds (if you want it to start 10 seconds after the scene loads) If you want to activate it at some other point in the game (for example, 10 seconds after you shoot something), then un-check the "Play On Awake" variable on the particle system component, and when you want the 10 second timer to start, use the code
gameObject.GetComponent(ParticleSystem).Play();And your particle system will start playing :)
If you're using the old system, just let me know in a comment and I'll add the instructions for that :)
I believe you want to call Play
ins$$anonymous$$d of Emit
:)
I am using the old system, but I'm going to get Shuriken ins$$anonymous$$d, because it sounds much, much easier. Thanks! :D