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
↧