How do I dissable a button for a certain period of time?

Get help using Construct 2

Post » Sun Mar 23, 2014 3:50 pm

Once the player, for example, presses space bar, I want him to not be able to press it again for 3 seconds. How do I do that?
B
6
S
1
Posts: 22
Reputation: 600

Post » Sun Mar 23, 2014 4:24 pm

You set a variable when it gets pressed, and then in the following action, set a "wait" for 3 seconds before resetting the variable.
When the spacebar is pressed, if that variable is not set the event runs, if it is, nothing happens.

Image
B
233
S
62
G
33
Posts: 902
Reputation: 40,398

Post » Sun Mar 23, 2014 4:38 pm

Paradox wrote:You set a variable when it gets pressed, and then in the following action, set a "wait" for 3 seconds before resetting the variable.
When the spacebar is pressed, if that variable is not set the event runs, if it is, nothing happens.

Image

Awh, I was really hoping for a less messier way, I'm already getting lost in my event sheet even though I haven't even finished programing my main character :P Neverthless, your ida worked, thanks alot :)
B
6
S
1
Posts: 22
Reputation: 600

Post » Sun Mar 23, 2014 4:52 pm

It doesn't have to be a variable, it could be when you press the space, your character changes in some way for three seconds, and you just check to see if the change is still there. It all depends on what else your doing.
B
233
S
62
G
33
Posts: 902
Reputation: 40,398


Return to How do I....?

Who is online

Users browsing this forum: Euduardo, Kin and 30 guests