How can I get all AudioStreamPlayer nodes and stop them?

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

To be more specific, my scene has a node called “OST”. Inside of it there are multiple AudioStreamPlayer nodes (each one with their own name). How can I get all of them and stop them when I press a specific button?

Using

get_node("OST/songname").stop()

for all these nodes is time consuming and I want to simplify it somehow.

Any recommendations?

:bust_in_silhouette: Reply From: rossunger

Add all your audioStreamPlayer nodes to a group!

then you can call get_tree().call_group(“myAudioPlayers”, “stop”)

I can’t express how thankful I am man!

ManuelArtz | 2022-02-13 12:10