0 votes

Hi!
I cant figure out how to make code for input.
When you bound a key to a action, action will happen every frame as long as you ceep button pressed down.
How can i write code to make it check - was it pressed- only once, untill its released and do that again when needed (like with attack functions)
But without Timer nodes...

p.s. Im guessing you are operating with "was_pressed" or such functions...?

in Engine by (227 points)

2 Answers

0 votes
by (7,946 points)
–1 vote

I've made a video response to this question. :)

How to handle input and prevent looping;
QA Answer

by (508 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 Frequently asked questions and 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 [email protected] with your username.