{ var gameMusic : GameObject = GameObject.Find("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.
(comments are locked)
|
|
try putting your music player on a level before your main menu page.
(comments are locked)
|
|
Another more robust way would be to make the sound player singleton. Seems like you are doing it backwards and destroys the old object and allows the new one to be created. Some pseudo code:
(comments are locked)
|
