Problem playing sound in animation player

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Andrew Maher

I have a coin (Area2D) when the player entered it, it plays an animation that has a sound effect, and then queue free, and it doesn’t work

func _on_Coin_body_entered(body: PhysicsBody2D) -> void:
	if body.name == "Player":
		stats.increment_coins()
		destory(true)

func play_die_anim() -> void:
     $AnimationPlayer.play("die")
     yield($AnimationPlayer, "animation_finished")

func destory(play: bool) -> void:
	if play:
		play_die_anim()
	queue_free()

:bust_in_silhouette: Reply From: andersmmg

Instead of controlling the playing property, you should use the audio player action. It’s in the Add Track menu, second to last.