0 votes

Hi people,..
i have animated sprite with multiple animation, when i press specific keyboard key one of them is playing, but the problem is that if i press the key quickly (quick press and release), just beginning frames of animation plays. how can i calculate the intervals of key pressing and disable the specific animation if pressing intervals is smaller than animation time?
thank you

(p.s: i use godot v2.1.5)

in Engine by (75 points)

1 Answer

0 votes

I don't know how short are your animations but you can try something like:

Have a timer with the minimal interval time you want to wait to play the animation, say 0.1secs , when the key is down run the timer if it's not, and then with the timer's time out signal connected to the function that runs the animation.

by (318 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.