+1
Fixed

Detecting Double Presses and Button Holds

Roni S. S. Palermo 3 months ago in Game Creator updated by Dornano 3 days ago 8

Hey, all. How you doing? I'm new around here and have a few doubts about Game Creator. Could anyone more experienced help?

I got Game Creator to speed up a project I wanna get off the ground. I took a look at the overview videos available on YouTube and really dug the way Game Creator is abstracting game dev... Anyway, I'm interested in maximizing the amount of input I can squeeze out of every button I use in my game. For that reason, I want to detect not only button presses, but also double presses and holds.

I figure I can put that together using Actions, Conditions and Triggers if I could do some math with Unity's Time.time or Time.realtimeSinceStartup. Is there a way to access those values using pre-built ways in Game Creator or should I dive into the Game Creator API and code a custom action for that?

Unity version:
2018.4.15f1
Game Creator version:
1.1.5
GOOD, I'M SATISFIED

Thanks for the help!

Satisfaction mark by Roni S. S. Palermo 2 months ago
Planned

Hi Roni;

A button hold can be activated using the On Key Timeout Trigger (I believe that's the name, I don't have GC with me at the moment to check it). Basically, it allows to execute the Trigger after a button is being held down for a certain amount of time. You can choose between firing immediately after the timeout has reached zero (without releasing the button) or wait until the user releases the button.

As for double clicks/taps/strokes... That's not built-in at the moment, but I'm opening a ticket to add it. Hopefully for the next release (shouldn't take long). I'm leaving this topic as Planned until we add it.

Cheers!

+1

Hey, Marti. Thanks for reaching out! I'm trying to put something together with the Actions, Conditions and Triggers available to me at the moment. If I reach something satisfactory, I'll share with everyone. But I'll be eagerly waiting for further updates!


Thanks for the response!

Awesome! Let me know if you have any questions :-)

Fixed

I've just implemented the double click option for Left Mouse Click, Right Mouse Click and Middle Mouse Click Triggers. I'm closing this issue. This will be available in the next Game Creator update (luckily, Unity won't take long to review it).

If you have further questions, let me know down below.

hi marti,

what about double clicks for on key down?

for example double tapping left can be dash left.

thx!

I'm sorry to pull this topic up, but I have a very similar request.

Do you know if we can do an On Key Down and an On Key Hold on the same button?

Like: short press E to make a small attack / hold E to make a big attack.

(unless it's already supported in the actual GC?)

You can use a "On Key Hold" with 0 seconds and another one with a couple of seconds. That should do the trick :-)

Ok, I will try, thanks ^^