How to make platform run by double taping the key and run animation problem

I don’t how to double tap key pressed but I manage to make character run but the animation is stuck in 1 frame how to fix it

Depending on how you play the animation maybe you need to set the run animation to loop and when double tap just add a trigger once on the animation to let it run in loop.

Double tap on X/Y point
Move the player to X/Y
Trigger Once
Player animation run
So this way when the user double tap a point in the screen the player will move to that point and play run animation one time and since is a loop animation it will be run forever until you pause or stop the animation.
I guess when the player reaches the X/Y target you maybe need to change the animation to idle or wherever you call it.

You can modify the “Mouse double-clicked” extension to do that relatively easily:
Demo video

But it’s keyboard double pressing key

Is a double tap on touch screen? or a double pressed key?

It’s on keyboard double key pressed

@ErmesBertone may know about that. He made something like that for his demo project.

Try this too:
If the run key is pressed
In the Child Event
Timer ‘double’ is greater than 0.6 then (inverted)
Change the maximum speed of character to (something more than default)

In another child event
Timer ‘double’ is greater than 0.6 then
Reset timer ‘double’

Pls send a pic or gif of it

I have made a project and there was some issue so I couldn’t connect but now I am back and here is your example.

Double press the movement keys to run faster.

>_> I am aware, have you watched the video I linked?

Thanks Mixen. I made it in this way, you need two scene vaiables.

“pressed” is a scene variable where you store the info about the run key is pressed or not
“timer” is a scene variable we use as a timer.

the loop is:

set to “0” the scene variable “pressed” only if the run key you want to double tap is unpressed.
control if variable “timer” is >0, if true decrease timer.

if the run key is pressed:

make the action normally you want to do, like “Walk”

but as sub-event:

A) if the variable “pressed” is 0 and variable “timer” is 0 set “pressed” as 1, and set variable “timer” at the value you want as delay for the double tap

B) if the variable “pressed” is 0 and variable “timer” is greater than 0, set “pressed” as 1 but make the option to “RUN” OK.

a bit complicated. but it works.

1 Like

Hi I know this is an old post but can I get a screenshot of the code or an example file of how it works. I am not good with the timer aspect of Gdev but would really apricate the help