- Home /
Question by
ToxicWarrior12100 · Sep 01, 2014 at 03:02 AM ·
javascriptparticlessimulation
Making A Particle Play when KeyPress And Particle Stop in 3 sec.
hello! im not good at all at scripting... I am making a Simulation Simulator (3 Simulators in 1)
and in my rock simulator, I want it to play a particle when I press "R" and then after 3 seconds, it stops... I need a script for that... and I wanna see how to use it to make it work,
I already made it so when you press "R" it plays "WWE The Rock theme song" (I made it 3 Sec. Short)
Comment
Answer by Reeceg · Sep 01, 2014 at 03:07 AM
if (Input.GetKeyDown (KeyCode.R))
{
ParticleSystem.enableEmission = true;
}
else
{
ParticleSystem.enableEmission = false;
}
do this and in the inspector set the particle system's duration to 3.
Your answer
Follow this Question
Related Questions
High quality lighter/candle flame simulation? 1 Answer
Can't Get gravity function to work 1 Answer
Blimp (airship) Script 0 Answers
gameObject.Find() returns null. 1 Answer
Working On A Sudo Fluid System 1 Answer