I have the audio source set to not destroy, and it’s continuing to play the original song it was set to, but I cannot play the new song I’m trying to set it to. I have checked other questions asking the same answer and attempted their solutions, but cannot get it to work.
private void Awake()
{
DontDestroyOnLoad(gameObject);
}
private void Start()
{
Load();
audioSource.Play();
cheatCount = 0;
if (volumeOff)
{
AudioListener.volume = 0.0f;
} else
{
AudioListener.volume = 1.0f;
}
}
public void LoadLevel(string name)
{
Save();
Scene current = SceneManager.GetActiveScene();
string currentName = current.name;
lastScene = currentName;
SceneManager.LoadScene(name);
if (name == "Level2")
{
audioSource.clip = Resources.Load<AudioClip>("Audio\\Escape! Soundtrack10");
audioSource.enabled = true;
audioSource.Play();
}
}