Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Kair0ss |
To clarify I’m making a simple platform fighter (think Smash Bros) and I want to have the character walk and run using the same keys. I decided on making them run if the key is pressed quickly and walk if it’s pressed slowly (the keys I’m using are A and D for left and right respectively). And thus we come back to the title question.
BTW I’m super new to this engine/ GDScript so I’d appreciate as much detail as you care to give. Thank you in advance.
I don’t think it’s possible for a computer to know how fast you hit the button.
Merlin1846 | 2020-03-03 15:42
Indeed, all common keyboards out there have digital input, which means each key has an “all or nothing” strength. This is in contrast to gamepads or the elusive analog keyboards.
Calinou | 2020-03-05 10:03
So like Krippi said. Just use something like double tap or even a shift button combined with walking to either run or walk.
Merlin1846 | 2020-03-05 15:20
Had a feeling this was the case, thanks for clarifying. I intend to have gamepad support as well so I just went with having a sprint key for keyboard.
Kair0ss | 2020-03-05 17:50