- Home /
Question by
SpeedTutor · Oct 07, 2013 at 12:17 PM ·
javascriptbasic programming
On / off code
I'm struggling with something basic, I can't get my head around it.
Say I have:
if(Input.GetKeyDown("2"))
{
doSomething = true;
}
How can I code this so that when I press "2" again, it changes to false. Then vice versa, press "2" to switch on, then again to switch off.
Cheers.
Comment