- Home /
how to make the music better
so I put music individually in each and every one of my scenes but when i go to the next scene the music plays again from the beginning
my levels are really short so the music plays for about five seconds
I want the music to play all the time in all the scenes without starting over again
btw the music is in video form i recorded the music and then imported and into unity and set it so only the audio appears
You would need to stop your script from getting destroyed when you load a new scene (DontDestroyOnLoad). You should have a look at this video: https://youtu.be/6OT43pvUyfY?t=739. At 12:19 in the video your exact problem is addressed and solved.
Answer by Vivien_Lynn · Aug 17, 2021 at 04:03 PM
Generally speaking you have to use DontDestroyOnLoad. With this implementation your script will persist between scenes, so the class does not get destroyed when loading a new scene.
Your answer
Follow this Question
Related Questions
memory usage of compressed audio playerback iphone 1 Answer
Cycle things with one key 1 Answer
How can i create an AudioClip from byte array? 0 Answers
Trigger Start of Sound 1 Answer
Music continued in the all level 1 Answer