I’m trying to work on a project where
- Audio is paused (or volume lowered) after reaching a trigger || Which I’ve had no issues doing
- Audio is unpaused (or volume restored) after loading a new scene (or hitting a trigger in the new scene) || Which I have had no success with
I am aware of using DontDestroyOnLoad to maintain audio through the scene, the issue im having is any changes made to the audio in the first scene seem to be permanent.
I’ve tried putting a trigger in the second scene that is meant to unpause or increase the volume (does nothing)
[SerializeField] private AudioSource BGM;
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
BGM.volume=0.1f; // its very loud, lowered volume is 0.01f
}
}
and having it launch on start/awake, attached to the audio source itself
[SerializeField] AudioSource BGM;
void Start()
{
AudioSource BGM = GetComponent<AudioSource>();
BGM.Play();
}
}
I’m not sure what else I could provide, but any help would be appreciated c: