R
Rax135
Guest
Hey everyone,
i wanted to know if there is a way to "toggle" between two values of a variable when i press a key. e.g.:
if key_pressed = true {
if state = true {
state = false;
}
if state = false {
state = true;
}
}
i tried it like the code above, it didnt work. switching the state to true works, but pressing again does not work.
i wanted to know if there is a way to "toggle" between two values of a variable when i press a key. e.g.:
if key_pressed = true {
if state = true {
state = false;
}
if state = false {
state = true;
}
}
i tried it like the code above, it didnt work. switching the state to true works, but pressing again does not work.