- Home /
how to turn on and off particles with key press
Hi im trying to make a particle system turn on and off when i press a Here is the script:
public class RunLines : MonoBehaviour { public ParticleSystem particles;
void Start()
{
if (Input.GetKeyDown(KeyCode.W))
{
particles.Play();
}
if (Input.GetKeyUp(KeyCode.W))
{
particles.Stop();
}
}
} My problem is that the particles dont play when i press the key. Can anyone help?
Comment
Oh $$anonymous$$y Gosh It Worked! Thanks Appreciate The Help.