function Awake()
{ var gameMusic : GameObject = GameObject.Find("GameMusic");
DontDestroyOnLoad(gameObject);
if (gameMusic)
{
Destroy(gameMusic);
}
}
This script allows the background music to play through the different scenes, but when I get back to the main menu page, the music starts all over again, overlapping the one which is continuing from before. How do I stop this from happening?
Thank you.