Combo System

I am making my own combo system but have a bug when I attack it plays one anim montage and then the next one when I try to press button again it just resets it back to first animation and then plays both.



If you need more information let me know.


here is more information

forgot these ones


Try setting the combo index from the completed pin on Play Montage.

What you described (the third press restarts the first montage while the second one is still playing) is the end event of the first montage, not the index math.

Play Montage on the same slot interrupts the previous one. That fires On Blend Out / On Interrupted on montage 1. If that pin sets the combo index back to 0 and plays the first montage, you get exactly this: the new press starts montage 2, the interrupt callback resets the index and starts montage 1, and both blend together.

Setting the index from the Completed pin will not fix a combo. Completed only runs when a montage is allowed to finish. A chained attack never gets there, because the next montage interrupts it.

Two setups that avoid it:

One montage with sections (Attack1, Attack2, Attack3). On the attack input, if you are inside the combo window, Montage Jump to Section for the next section. Do not call Play Montage again. Nothing is interrupted, so nothing resets.

Separate montages: before you play the next one, set a bool bChaining. In the montage end event, if bChaining is true, do not reset the index and do not play anything. Clear the bool after the new Play Montage. Only reset the index to 0 when the combo window notify ends and the player did not press again.

Also put both montages on the same slot. Two different slots will play both at once even when the index is right.

Here’s how I’m doing combo attacks in my current project:

Also, the anim notify that fires damage event right at peak of punch or sword swing also sets bCanAttack back to true so the next hit can be chained in before the wind down of the montage finishes.

Teh retriggerable delay is safety net in case anim doesn’t play or something. And to clear bInCombat so anim bp switches to passive idle state.

Since I have my attack montages in an array and get one by the combo count, then set combocount to +1 modulo’d by array length, I can add as many anims to the array I want without having to change the code. Whether I have 2, 4, or 10 anims in the array, that modulo node (%) loops the count back to 0 if the +1 is bigger than array.

I combined my interfaces and trace logic with your logic it was useful thanks