When the player loads the game and enters the first scene, music plays. I designed it so that the same music plays throughout the scenes. The problem is that if the player goes back to the initial scene (the scene that started the music) it plays the music again and you can hear it twice at the same time. How can I disable this? I would like the music to only be playing once and on a loop. I don’t want the music to play twice if the the player goes back to the first scene.
How do you play the music? The best way to deal with music and things like interface sounds is to have a few audio sources that you dedicate to tasks. So you have one just for your background music for example. Make sure that object lives throughout the game by using DontDestroyOnLoad, then simply control that audio source to make it stop/play/change volume etc.