I need help in playing multiple background musics,
i have 3 music clip, i attached them to 3 different objects in my scene, i have one audio mangaer script in my scene which works like this,
var ambient1 : GameObject;
var ambient2 : GameObject;
var ambient3 : GameObject;
function Start () {
ambient1.audio.Play();
}
function Update () {
if(!ambient1.audio.isPlaying)
{
ambient2.audio.Play();
if(!ambient2.audio.isPlaying)
{
ambient3.audio.Play();
if(!ambient3.audio.isPlaying)
{
ambient1.audio.Play();
}
}
}
}
but it only plays first ambient, it does not play anyother ambient…
is there something i am missing?
and also, how can i add a delay of 2 min between them?