Quantcast
Channel: Questions in topic: "dontdestroyonload"
Viewing all articles
Browse latest Browse all 416

Can't access an object which is in DontDestroyOnLoad

$
0
0
Hello guys, first of all i want to say that i am a complete noob concerning unity programming therefore i would gladly appreciate your help. So my problem is that i have a background music object in DontDestroyOnLoad so my audio file gets played seamlessly when switching scenes. I also have a toggle mute button in one scene which works exactly like it should when i start the game with this specific scene. But when i switch scenes and come back to that one specific scene i can't use my toggle mute button anymore and get the error: "The object of type AudioSource has been destroyed but you still try to access it". I know the reason for this is that my backround music object is in dontdestroyonload. How can i fix it? Or how can i access this background music object which is in DontDestroyOnLoad? Please help me i am kinda lost right now. :)

Viewing all articles
Browse latest Browse all 416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>