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

Working between different scenes!

$
0
0
I have a gameobject on Main Menu that contains a muted Audio Source. When I hit the Level 1 button, the Audio Source is unmuted and the music starts playing. Also, for this to happen the gameobject has "DontDestroyOnLoad". Now I want to go back to the Main Menu by pressing another button, and I want the Audio Source to mute again. The thing is I'm not able to mute it, because I tried working with the "OnClick()" of the "Main Menu" button (the one that brings you back) to mute it, but I can't reference the gameobject because it's not on Level 1 yet! What I also tried was to order the Audio Source to mute when "button" is pressed, but I can't reference to the "Main Menu" button because it's on Level 1 :s (and gameobject is on MM). I'd accept a workaround if this is really not possible.

Viewing all articles
Browse latest Browse all 416

Trending Articles



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