I’m new to Unity and I am making a simple game. On the main menu I have a soundtrack on and I would like for the music to continue playing in the next scene rather than restarting. Is there anything in Unity or any Code that may help me achieve this? Thanks in advance.
In a nutshell, call DontDestroyOnLoad() on the object containing the AudioSource playing the music. For additional details (including a simple way to avoid multiple copies of the same persistent object being created, which could happen in this case if you later return to the main menu without destroying the original music-producing object), see the answer to this question.