Hi everyone. I want to make a simple menu system whereby if I push the button once, the menu pops up. If I push it twice, it disappears.
Sounds simple, right? In the pointerdown script associated with the button, I’ve tried assigning a variable to the button state, so that the variable is 0 to start and then 1 after the first push. An if statement is meant to reset the button:
var buttonPushed = 0
If (buttonPushed = 0) {
play the opening menu animation;
set buttonPushed = 1} else {
play the closed animation;
set buttonPushed = 0}
Should work. Doesn’t. Seems to be looping or not responding at all.