In AnimationPlayer,I add a call method track. This method should be called at the end of the Attack animation, then the IDLE animation will play. But when I "attack" quickly, this method doesn't get called, the attack animation stays on the last frame and I can't go back to IDLE state

    011eh You might want to provide a minimal reproduction project to attract more feedback.

    Connect the signal "on_animation_finsihed(anim_name)" to func _on_animation_finsihed(anim_name) as in:

    func _on_animation_finsihed(anim_name):
    if anim_name == "ATTACK": get_node("AnimationPlayer").play("IDLE")

    NOTE: This assumes that your "attack" animation is called "ATTACK", and your idle animation is called "IDLE".