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

Audio source to be played across all scenes without being destroyed?!?

$
0
0
Hello. I was wondering what is wrong with my script. I have attached it to the camera and made an audio source there: var song : AudioSource; function Awake () { if (!audio.isPlaying){ audio.Play(); } else if(audio.isPlaying){ DontDestroyOnLoad (AudioSource); } } function Update () { if (!audio.isPlaying){ DontDestroyOnLoad (AudioSource); audio.Play(); } } Thank you :D in advance :D

Viewing all articles
Browse latest Browse all 416

Trending Articles



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