Help with Intro Music across Levels

Hi All

I’m really new to unreal and I am trying to add some music to the main menu of my game. I want to be able to play the music in the background whilst I go between them main menu and the player menu level, then when it goes into the first level the music stops. I used ‘Spawn Sound 2D’ and selected the music I wanted, and ticked the ‘Persist Across Level Transition’. It works when i go from Main Menu to Player Menu fine, but when I go back to the Main Menu the music doubles up and the music plays twice over the top of each other.

I’m not sure if the way I have set this up is the best way, but if anyone could suggest the best way to do it that would be great. thanks

my guess is because you are starting the music on main menu start up when you are going back to the main menu its starting the song again so what you need to do is find a way to only ever start the music once. A way you could do this would be with a save game which allows you to set variables that wont get reset when you open a new level

Put an IsValid node on MainMenuAudio to find out if it’s already playing :slight_smile: