call the $AudioStreamPlayer.play() before you change the scene. if that still doesnt work, connect the $AudioStreamPlayer 's finished function to do the scene change so that it only changes the scene as soon as the audio has finished playing.
You have to wait with the scene switching until the sound has finished to play, otherwise you won’t hear it. A quick way to do basically what dustin proposed is to yield until the finished signal is sent:
Button sound is working when I click it, but now the scene does not change. Can someone help me? Thanks!
Guzzard8 | 2021-12-11 18:26
This works but if there is extra time in the sound it will wait until the empty part of the sound is over until it will change the scene. Another way to do it would be to use an autoload.