Make _input function be called on hold (or every) input #11815
Bruszan
started this conversation in
Engine Core
Replies: 1 comment 1 reply
-
Changing the behavior of |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I love Godot and how intuitive everything is, but in my experience, handling input hasn't been that way basically because the _input function is only called when there is a different input compared to its last call, meaning that held buttons, clicks and analogs won't be calling it on the next subsequent frames.
And for me that's caused a lot of unnecessary confusion, for example, I wanted my character to do an action every frame/tick while a button is held. Thankfully, the _input function can make it efficient by tracking the action only when there is input, but the issue is that if the input is the same as the last call, it won't be tracked, making functions like _is_action_pressed() on _input pointless.
So even if most of the time this specific input won't be pressed, the only way currently is to track if the button is being held every frame/tick on _process, making it very inefficient
My first suggestion would be simply to make the _input methods be called every time there is input, even if it's the same as the last call, but considering that's probably intentional, I would suggest to make a new input method which works that way, because I know people will like to use it for situations which something must be called every frame/tick while holding a button without tracking the input every frame/tick.
Beta Was this translation helpful? Give feedback.
All reactions