How the heck do you detect a double key press?

Get help using Construct 2

Post » Sat May 04, 2013 9:33 am

So I'm trying to make a dash by double tapping a key, and my code looks like this:



However, it seems to immediately set dash to true, trigger the event that says "if true and if a is pressed" and then set it back to false instantly, setting the dash effect off in the process every time the A key is pressed.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Sat May 04, 2013 10:06 am

If you put a System -> Wait 0.0 seconds action in your first event, it should prevent that from happening.
B
56
S
15
G
10
Posts: 910
Reputation: 11,972

Post » Sat May 04, 2013 10:15 am

Oh..That's weird.
Thanks. It worked. =)
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Sat May 04, 2013 10:23 am

I've struggled with similar issues in the past, so I get that it seems weird. The way to think of it, though, is that the actions are trying to run at the same time. Putting in that wait command effectively forces them to run independently.

At least, that's how I see it. I'm not sure how accurate that really is.
B
56
S
15
G
10
Posts: 910
Reputation: 11,972


Return to How do I....?

Who is online

Users browsing this forum: Zebbi and 24 guests