Hello!
So my script plays music after 3 seconds after you click play, but when the scene changes, and you come back to the scene wit the music, it starts right away, because the game has been playing for longer then 3 seconds. But I am getting an error saying that “void is not a valid macro.” Someone on the last thread said it was because I had capitals, but I did not. Here is the script:
var song : AudioSource;
function Update () {
if (!song.isPlaying && Time.time >= 3) {
song.Play();
}
}
void Start()
{
Invoke("PlayMusic" , 3);
}
void PlayMusic()
{
song.Play();
}
Hopefully some can help me out, I have been delaying the game because of this.