Hello I’m new here
I’m having a hard time with the Audio(BG Music) of my scene, I created a BG Music to my first scene that will continuously play even going to another scene. My problem is that if I go back to the that scene(first scene) where I put my BG Music it will play the BG Music again, making it double BG Music(x3,x4,x5… As I go back to that scene again)
Sorry for my wrong grammar ![]()
BTW this is my code:
function Awake()
{
if(GameObject.Find("TronBG") == 1)
{
Debug.Log("IF");
Destroy(gameObject);
}
else
{
Debug.Log("ELSE");
DontDestroyOnLoad(gameObject);
SoundSource = gameObject.AddComponent(AudioSource);
SoundSource.playOnAwake = false;
SoundSource.rolloffMode = AudioRolloffMode.Logarithmic;
SoundSource.loop = true;
}
}
I like this: less noise placed in the tag system.
– KellyThomas