- Home /
Question by
Seikomega · Apr 13, 2021 at 12:11 PM ·
scripting problem
Keep music playing when i reset a scene but stop it when i change scene
I have a simple game where if you die or press r the scene resets and music doesen't restart (i'm using DontDestroyOnLoad) but the problem is it still keeps playing even when i change scene i.e. when i go to the main menu, how can i fix this?
Comment
Answer by Darkluca · Apr 13, 2021 at 03:08 PM
Why not make an if statement declaring to only run dontdestroyonload when on the game scene else destroy it?
Your answer
Follow this Question
Related Questions
Check the material in script [C#] 1 Answer
Convert List of Floats to Colors (Color Map) 2 Answers
Why wont my script detect the input of my controller? 1 Answer
Script Not Working On Prefab 2 Answers
Grab and Drop Script goes through walls. 0 Answers