AudioStreamPlayer duplicate generation bug.zip (1.6 MB)
Reproduction Steps:
-
Open the project and enter the project test

-
Press the Z key to play the AudioStreamPlayer (a node that does not get cleared)
-
Press the X key to play the AudioStreamPlayer2D (a node that does not display)
-
Then open the remote scene tree on the left to view the nodes of the core scene
-
Continuously pressing Z results in the creation of many AudioStreamPlayer nodes that are not cleared
Problem Location:
-
Located in the game object’s VS [State Machine] → [Action] → [Play Sound]
-
If AudioStreamPlayer2D is not enabled, AudioStreamPlayer nodes are repeatedly generated

Additional Observation: Furthermore, after repeatedly playing the audio, when returning to the character interface scene, playing the root node’s AudioStreamPlayer-bug, AudioStreamPlayer-bug2, and AudioStreamPlayer2D-bug3 in the inspector on the right results in overlapping, repeated sounds.
AI Analysis:
Why does this happen?
The PlayAudio action in AGM has two hardcoded destruction logic paths:
AudioStreamPlayer2D branch: The plugin automatically connects the finishedsignal internally and callsqueue_free()to delete the temporary node after the audio finishes playing, so the scene tree does not accumulate nodes.
Standard AudioStreamPlayer branch: The plugin does not bind an automatic release logic for the finished signal. After the sound effect finishes playing, the node remains in the scene tree, merely stopping sound output. Each time you switch weapons and trigger playback, a new node is created, leading to accumulation.
The standard AudioStreamPlayer itself has a
finishedsignal; it’s just that this AGM action does not connect automatic destruction for the standard version, only providing release code for the 2D version.