help with combo attacks.

hello, i’'m working on a hack & slash game and currently almost close to finish the character actions(attack, jump, crouch, walk, run), then currently i’m stuck on combo part, i means when you press the buttom more than 1 time he start to make different attack in a chain.

while i’ve already made the "chain attack, the thing i’m currently stuck is about how to make 2 conditions on how to "trigger this chain:

1 - he only goes “combo” if his “hitting something”: like the enemie if you are just “pressing the buttom” the character will just play the “first attack” all times and only goes "combo if he hit something with the attack

2 - if the character press the attack buttom then 'take a little time before press again the attack buttom it will “reset” the combo and the character will do again the first attack, let’s say if i keep pressing the buttom then the character will go combo normal, however if i press the buttom then let’s say take more than 1 sec to press again then he goes back again to do the first attack instead of keep the combo.

here my combo node:

this allow me to “chain combo” however i’m stucked because it’s Aways" do the combo, i means even if for exemple i click one time the buttom then start to move around and do others things if later i press again the buttom it don’t go back do the first attack but it do the “second” then the third, only after i’ve did the “full chain” which it’s “reset”, i want to be able to reset if the player take too much time to "click again and or it’s only trigger the chain if the character hit something and only keep chain as long he is hitting something and don’t take too much time to press the buttom, like if him hit the target one time then press the buttom again fast it go the second attack but if the character take “too much time to press again it will reset back to the first attack no matter on what attack number it is (it’s aways will reset the attack count to 0 after x times passed if the character don’t hit anything or take too much time to press the buttom”.

those are my question, how to reset the attack count back to 0 if: 1- the character take too much time to press the buttom; 2 - if it take too much time to hit something or is not hitting anything, just clicking the buttom without hit anything.

the basic idea is if the player is just pressing the buttom without hit anything it will just keep doing the first attack forever, then only after it hit a “enemy” which it can trigger the chain which will happens if the player press the buttom fast enough otherwise if him dont press fast it will just reset back to the first attack and keep doing the first attack without go chain until him start to actually hit it fast enough to keep the chain.

Another thing which i would like to know is how to after the “last blow from the chain”, send the enemie "go away, i means after he take the last strong blow or any special blow with this type of power, it knock far away the enemie from the player, how to do that and how to control the distance/lenght the enemie will be throwed away.

Hi @Ellessarr

Here an example of a combo system with timer and hit, with 1 button.
I am using a simple integer and making all attack set the same timer,
But you can make an array of float and grab a different time for every attack , taking the Timer-Array get “Atk_number”.

Input Attack will call the event ComboCheck, then he will call the Attack N 0,1,2,3,4

You can always start the first attack
then a timer is set , if you are too slow, the next will be another first attack,
If you hit in time , and the previous attack was a hit,
you will continue the combo.
Otherwise back to first attack (with attack combo number 0)

2 Likes

ok let me see i must colapse all of that my “bp” in a macro graph? then add that new nodes or i must create a full new new nodes with something like that graphs?

really good and looks exactly like what i want.

ok, i’ve managed to tag the character now the only issue is which the character is not “doing any combo”, just keep using the first attack on the target, i feel like i’m missing something.

it’s seens which it’s only running the “first part” the 2 custom events are not being called/checked.

Hi @Ellessarr

As you can see i put some print to my events,
You have to check:

if you correctly scripted the Timer… when you attack the timer get set to 1 and slowly reduced to 0 ?
Your attack is called before the timer is 0 ?
you hit attack in time but it didnt hit the target?
you attack hit something ?
You are correctly setting the Combo N?

use a lot of prints and take notes of all the variables changes.

the first node is working, at last seens to work because i’m getting a spam of “too slow” in my screen and my character only do the first attack, then to test if it goes combo "hitting something i’ve spawned another character and place on him a tag enemie (the name tag i’m using), then he just keep doing the first attack while i get in my screen a spam here my nodes:

my colapsed attack animation
the tick event come from outside and go direct to the second pin as it shows

now my first outside node:

now next node:

then to test i’ve added another character bp in the level with the enemie tag and started to attack it, but nothing happened he keep only doing the first attack and i get a spam of too slow

here my variables:

hmmm let’s be clear and make sure i’m not being just dumb and brainless, for this script work i need to add a hit dectection to see if he is hitting the character collision capsule??? or it’s work without it and just the character having the tag will trigger it???
here my characater (it’s just a mixamo prototype when the bp goes finished i will change the “mesh for the true character”) viewport:
moviment20.JPG
i’m asking that because on this point i’ve still not had added the “hit dection” part it was just the “play animation”, i’m still not implemented damage and take hit damage stuffs, that part was my next move after i had proper added the combo system.

@Ellessarr

Yes man , its hard check the whole bluprint, you have to break it down!
Check if you get a hit event.
Check if you can get the tag of the actor
check all your variable and steps.

and make a simpler blueprint,
even out of animation , maybe you can just collide with the other actor and print the attack combo on screen

hmm ok, for now i will try to go back to basis and do a "simple attack and do all the checks then after it working perect i will go back and try the combo stuff again, maybe it was something i missed from that stepps, thanks for the help and tips and support.

and if you don’t mind i will can send for you by pm my character bp for you to have a proper check on it, again if you don’t mind.