input.getbutton/whatever

hey folks!

input.getbutton/whatever() is being called every frame in the update() function, meaning that it will execute my code inside the {} of my input.whatever when i PRESS or HOLD DOWN the button. meaning it will also stop executing my code once i RELEASE the button.

my question is, does anyone know how to execute the code without having to hold down the code?

sorry for the CAPS folks, that’s where i want u guys to focus. any help is appreciated, thank you very much.

You want GetButtonDown instead, and upon it, set a variable. Something like:

if (Input.GetButtonDown("flameOn")
    flame = true;
if (flame)
    particles.Emit(5);

Presumably you wany another button to flame off, or toggle it:

if (Input.GetButtonDown("flameOn")
    flame = !flame;