- Home /
How to Destroy the DontDestroyOnLoad()
Hi guys! Hi have a problem... I used the DontDestroyOnLoad() for my menu music and it work perfectly. I have 3 scenes where the DontDestroyOnLoad() have to work but if I press the button to play the game I need to stop the menu music and to play the game music but i dont know how to do this...
Please help, thank you!
Answer by logicandchaos · Feb 02, 2020 at 06:27 PM
You don't need to destroy it just turn off the music, or switch the music to game play music.
Answer by tormentoarmagedoom · Feb 02, 2020 at 06:31 PM
Hello there.
Why you have the music code in the dontdestroyonload ??
Move it to another script that only exist int he menu, and make another script in the scenes with the other music...
Bye.
Your answer
Follow this Question
Related Questions
How to activate a function on script B but its called from A 1 Answer
Scriptable object problems 1 Answer
To pass a variable between scenes should I use scriptableobject or static ? 1 Answer
How do I make a photography function? 0 Answers
How can i calculate with a script automatic the planes positions to make small building ? 1 Answer