Combo system animation attack overlapping

I did the combo system but the animations keep overlapping each other when I click, I tried with a timer but it didn’t work


, my script: if combo_step == 0:
animation_player.play(“atacar1”)
elif combo_step == 1:
animation_player.play(“atacar2”)

combo_step += 1
combo_timer = 0

if combo_step >=2:
	reset_combo()

You will probably have to use an AnimationTree, I am not sure what result you want specifically.

1 Like

thanks, i will try

bro, How do I set the animated node state machine as scrpt?

In the same article there’s a “Controlling from code” section, does this help? There are a lot of different parameters to a AnimationTree, what are you trying to do specifically? What does your tree look like?

I saw the manual but I didn’t understand how to apply the script, I tried but it always gives error, I want to attack2 only start after attack1 finishes and vice versa, here my tree ( atacar is attack)

I made something like this work. However, I also had an idle/walk/run state in the state tree to go back to. The way you have this setup, you can only do 1 then 2. I recommend you go follow a tutorial or three on animations with state machines. Here’s one you can look at.

Every possible animation path has to be in the state machine to work in code. It is possible. You just need to make sure the state machine has Run at End selected in the transition.

Running through a few tutorials will help you master this, as it is complex.

Honestly though, I recommend you re-think the combo attacks. I don’t have code to share because I pulled it from my game after playtest feedback. Just map each attack to a different button and save yourself a lot of headache.

1 Like

thank you, brother, i will watch

1 Like

well, i watched a recent video of this and did everything right, but it’s giving null, I don’t know why,


Screenshot 2025-02-10 131018
compilation of errors said that the animation tree was not in the character body and I tried to fix it but I did worse, now when it runs everything is black, without scenery

Screenshot 2025-02-10 130339