How to Store a button combination attack for a set length of time before having to re enter it

Hi all,

I’ve searched high and low and can’t find anything on this subject.

I am creating a game that uses certain button combinations to trigger an attack/spell (up,down,left,left). I am making it so that you can aim and use the spell in first person, so I will need to store the spell after the button combination has been correctly entered for a set amount of time (3 seconds) before the attack combo disappears, and you must enter it again. In addition, if you were to get hit during the spell storage, you would need to re-enter the combination again.

Would anyone be able to lay out for me in blueprints how to achieve something like this? Thanks again!!

If you set up the combo with enhanced input actions, you could; just set the Time To Press Key to 3s for the last button in combo. Or you could have the up/down/left/right combo set a bool to true, and reset it after a delay or a timer event. If bool is true the attack button or whatevs would then fire the spell.

IA_Combo looks like this:

And if you want to cancel combo on damage taken, just set the special bool back to false in a any damage event.

Well I feel silly, I mean I thought there was no way it was as simple as setting a Boolean to make this work lol the timer by event though is clutch, sometimes overthinking is the enemy! Appreciate this and it worked perfectly!

One last question since you’ve been of such help and I haven’t gotten as far as trying this in game, how would I used the stored attack while making sure that A. Other button inputs cancel the stored attack and B. Using L2 to aim and R2 to use the attack do not cancel out and are able to properly deliver the attack in the specified time?

Cancelling combos is a bit wonky. In the combo action dropdown, there’s a section to add cancel actions, where you can make an array of other input actions which stop the combo. Not sure how well that works with extra presses of an action that’s in the combo tho. But in theory, pressing buttons out of order should stop combo anyway.

And to spice things up later, you could make an enumerator of combo actions, make a variable using it, and set the enum instead of just a bool, then check if enum=whatever instead of the bool (maybe use switch on enum?). Then you could seamlessly add a left/right/left/right or whatever combo later. Just gotta remember to update the enumerator bp whenever you add a new.combo.