I put an FSM in my game based on the GDQuest implementation and I'm currently trying to get an attack state working, but it gets stuck. There's a function called at the end of every attack animation that's supposed to change a bool to allow the player to go back to their idle state, but for some reason, the animation doesn't play and, as such, it ends up locking the game. My code isn't much different from before when it wasn't an FSM and everything mostly worked fine there. I even tried following a tutorial I found that has a similar solution to maybe figure it out, but nothing has worked so far and I'm clueless as to why it's happening.
Attack state:
#Attack
extends State
func enter(msg := {}) -> void:
owner.isAttacking = true;
if msg.has("stand_light_attack"):
owner.animState.travel("AttackLight1");
func physics_update(delta: float) -> void:
if !owner.is_attacking:
if owner.is_on_floor():
state_machine.transition_to("Idle");
Player script with attackEnd function:
class_name Player
extends KinematicBody2D
#VARIABLES
export var gravity: int = 4500;
export var maxFallSpeed: int = 2750;
var isAttacking: bool = false;
var animState;
var velocity: = Vector2.ZERO;
func _ready():
animState = $AnimationTree.get("parameters/playback");
func _physics_process(delta):
velocity.y += gravity * delta;
func attackEnd():
isAttacking = false;