queue_free() causing sound issues with strange 4 second delay

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

enter image description here
So I’m just trying to make a coin disappear when I walk over it and also play a sound. So here is what happens.

func _on_Coin_body_entered(body):
$coinsound.play()
emit_signal(“coin_collected”)

With this code the coin doesn’t disappear but the sound plays.

func _on_Coin_body_entered(body):
$coinsound.play()
emit_signal(“coin_collected”)
queue_free()

With this code the coin disappears but the sound doesn’t play.

func _on_Coin_body_entered(body):
$coinsound.play()
emit_signal(“coin_collected”)

func _on_coinsound_finished():
queue_free()

And finally with this code both the sound plays and the coin disappears but with a huge problem of the coin disappearing after 4 seconds for some reason, even with the length of the sound only being 1 second long. I just want the coin to disappear instantly with the coin sound playing at the same time.