I'm trying to setup a three hit combo chain for my player character and figured the easiest way to do so would be to check if the player's current AnimationTree state is in the attack animation and if so, travel to the next attack animation on a button press, but I still haven't figured out how to get the current animation though. How can I do that?
My attack code currently:
func _ready():
stateMachine = $AnimationTree.get("parameters/playback");
#ATTACKS
if Input.is_action_just_pressed("light_attack") and is_on_floor() and !isCrouching and !isAttacking and velocity.y == 0:
isAttacking = true;
stateMachine.travel("AttackLight1");
elif Input.is_action_just_pressed("light_attack") and stateMachine.current == "AttackLight1" and is_on_floor() and !isCrouching and isAttacking and velocity.y == 0:
stateMachine.travel("AttackLight2");
else:
isAttacking = false;