Variable to enable and disable action (solved)

Hi,

I created a variable to prevent an action to accour, while the other is occuring.

So, the 1st action has the variable value 1 condition.
The 2nd action changes the variable to value 0.

What i’m struggling with is to get the variable to value 1 after the 2nd action is done.

I have this code, which it seems to work just once:


What am i doing wrong here?

Are you starting both timers at the beginning of the scene? Also It’s not clear why you are using two timers… they both seem to be for the purpose of throttling input processing… so I would think you can just use a single timer for that.
You may want to refactor your input logic to be separate from the resulting actions.

1 Like

I agree with @krunkster, I think the problem might lie in your timers. Are you starting the “controls_timer” at the beginning of the scene (or in some other way)? If not, then the sub condition will never be true and therefore the variable won’t be set to 1.

You might try moving the Reset the timer "controls_timer" action and putting it just under the Change the global variable controls: set to 0 in the previous event. That would start the timer and after 0.35 seconds the sub condition would be true and the variable will change back to 1.

1 Like

That was it! I just used the same timer and it works. Thanks for the help!

Also, removing the second timer reset solved other problem i just figured after!