Can anyone tell how to add a sound to a button in a menu so when it is pressed it makes a sound?
Also remember that as the button is pressed, it should make a sound and should change the scene too.
func _on_playagain_pressed():
get_tree().change_scene("res://Level.tscn")
$AudioStreamPlayer.play()
I have done this code but when I click the button, it doesn't make any sound even though I have set the sound on the Audiostreamplayer.