How to add double taping and button combination to games.

Hi. In my game I want to make button combinations for different fighting combos and double tapping buttons for things like sprinting. How can I do this and also make sure that if the buttons are not pressed within a second of each other, they will do individual moves?

Thanks for reading this,


I guess you need to handle each button press normally (otherwise you will have lag which is not pleasant for the player). However if another button is pressed very quickly (<.25 seconds?) then you cancel what you started doing and do whatever your combo / double tap is supposed to do.

I wouldn’t re-invent the input handling wheel for such a game. There are some nice ready made assets on the asset store that will handle a lot of input combos for you. You can concentrate on other aspects of your game instead.

Here is one such package:!/content/3283