[Solved] How to do 3 attack in a row

How do I…

I want to do attack combo.

What is the expected result


I hope I can explain what I want. so as you see there is 3 image above, which is simple combo attack. the attack is triggered by left click. first click should play the first attack, and if the time between first click and second click less than 1 second, the second attack would come, and if the time between second click and third click less than 1 second the third attack would come.
and if there is no click after 1 second of each row attack, the next click would play the first attack.

so, player should click 3 time to make the attack combo.
if no click combo, only first attack would appears. and the timing is less than 1 second each click.

What is the actual result


with that code, instead of doing what I want, the animation would jump to third attack instantly. I know something wrong, but I don’t know where is the problem and how to do it, so Please Help Me.

Hi,
I don’t know if this alone will make your events run as intended but you need to add to each of your “Touch or Left mouse button is down”- conditions a ‘Trigger once while true’-condition. Otherwise your mouse click is registered every frame and you are just switching through the states instantly.

I change the list like this


it works, but there is a problem.
the attack can be done with only 1 click that holded.
I’m thinking maybe I should add a click release to start the timer. but I don’t know where to put it. I put it there and the combo doesn’t work.

The ‘button is down’-condition in connection with the ‘trigger once’-condition is registering the click only once and not over several frames, it doesn’t matter how long you press it.

The problem is that your second event-block in the screen snip triggers when the timer is less than 0.5 seconds, which is instantly. You need to use the ‘bigger than’ sign instead and you can get rid of the ‘release button’-condition if you like.

thank you for your insight,
after try to rearrange the events and add stuff. I solved it.
I upload the events, maybe it help other to do the stuff.

1 Like

Good to hear that you got it working.

Btw you don’t need to add a ‘Trigger once’ for the ‘mouse button release’ events, it cannot be triggered more than once per click-release. There are probably other things that could be cleaned up a bit but the most important thing is that your events are working for you.