I want to make the UI to show and Hide when I press Tab.
But what’s happening is:
Condition:
Tab key released
The scene variable UI = 0
Action:
Show Layer UI
Condition:
Tab key released
The scene variable UI = 1
Action:
Hide Layer UI
But these events both active as soos as the variable changes state. Thus creating a loop that in the end, does nothing.
I know there’s a way to go about this by adding in a another variable that acts as a barrie for this, but I can’t seem to figure it out. Pls help.
Ty
Create a new scene variable and named it: GoInto
_condition (level 1): key released → action GoInto = FALSE
.L subcondition ( level 2): UI = 0 → action: UI = 1 and GoInto = TRUE.
.L subcondition ( level 2): UI = 1 and GoInto = FALSE → action: UI = 0
It’s the GDevelop ELSE command workaround
1 Like
Or you could just use the toggle Boolean for a Global, Scene or Object Variable.

As @jumpingj says you can do something like this.
1 Like
Muzan
#5
Yeah @jumpingj is right
You need a condition to check if the scene variable is on or off