I have a simple two chain combo attack that can be performed while the player is crouching, but the second attack won't go through.
var isCrouching: bool = false;
var isAttacking: bool = false;
var stateMachine;
var velocity: = Vector2();
func _ready():
stateMachine = $AnimationTree.get("parameters/playback");
func input():
var currentAnimState = stateMachine.get_current_node();
#CROUCH
if is_on_floor() and Input.is_action_pressed("crouch") and velocity.y == 0 and !isAttacking:
isCrouching = true;
$CrouchCollision.disabled = false;
$BodyCollision.disabled = true;
stateMachine.travel("Crouch");
else:
isCrouching = false;
$CrouchCollision.disabled = true;
$BodyCollision.disabled = false;
#Crouch light attacks
if Input.is_action_just_pressed("light_attack") and isCrouching and !isAttacking:
isAttacking = true;
stateMachine.travel("AttackCrouchLight1");
elif Input.is_action_just_pressed("light_attack") and currentAnimState == "AttackCrouchLight1" and isCrouching and isAttacking:
stateMachine.travel("AttackCrouchLight2");
func attackEnd():
if isAttacking == true:
isAttacking = false;
Upon testing it, my crouch collision hitbox becomes disabled while the first attack is happening, so I'm pretty sure it has to do with that, but I'm not entirely sure how to go about fixing it.