I’m trying to set up a combo slash system in my 2d platformer and can’t quite figure out how. As in you press the button 3 times in succession and you do a 3 hit combo, 2 times 2 hits etc. I read about doing this in 3d using animontage or something but as far as I can tell that doesn’t seem to work for sprites. Any help?
I would presume you would have a series of attack states that would have an Int variable and a timer on them. If the player presses your attack button you would add one to the variable and start the timer. If the player presses the button again within the window of the timer you would check the variable. If the variable is correct you would update the button to perform the next attack in sequence and add another point to the variable, and on and on for as many attacks that you would have in the combo.
If at any point the player fails to perform the attack before the timer ticks down, or is hit, or meets any other requirement you would reset the timer and variable to the beginning.
As for calling the correct animations, you’re on you own there. I haven’t gotten to them just yet!