Combos are normally done by saving the most recent say 5 moves in a queue data structure and then you can just check it to see if the player has pressed a combo.
In your case though are you hoping to have the player press a button DURING their first attack? In that case you will need some sort of timeout for the first attack.
Going like this:
1. Press attack, initiate attack and set the combo bool to true
2. Use an Invoke function(check the docs) which turns that bool to false after X seconds, maybe 0.5, whatever length you want
3. When an attack is pressed, check that bool, if its true it was pressed right after the last one and do your combo
↧