Animation player problem

Godot Version

4.2

Question

I am making a boss fight in my game . problem is in animations , every time it does play every two animations but i dont want it.
i want when the player entered in a_detector , that play animation A and when the player entered in b_detector ,that play animation B.

please someone help !

i would recommend to set up a variable that is set to false at the beginning, and sets to true as soon you entered the detector, like this:

var entered_a = false
func _on_a_detect_body_entered(body):
  if entered_a == false:
    $AnimationPlayer.play("A")
    entered_a = true