- Home /
Question by
Ep8s · Aug 23, 2021 at 11:32 PM ·
musicdontdestroyonloadmenu screenseamless
How to stop seamless music after loading a specific scene
I have seamless music playing in my menu of my game (dont destroy on load), but i want to stop the menu music when i boot up a level. Is there any way i could possibly do that? here's the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BGSoundScript : MonoBehaviour {
// Use this for initialization
void Start () {
}
//Play Global
private static BGSoundScript instance = null;
public static BGSoundScript Instance
{
get { return instance; }
}
void Awake()
{
if (instance != null && instance != this)
{
Destroy(this.gameObject);
return;
}
else
{
instance = this;
}
DontDestroyOnLoad(this.gameObject);
}
//Play Gobal End
// Update is called once per frame
void Update () {
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613042054im_/https://answers.unity.com/themes/thub/images/avi.jpg)