In Unity: Volume does not adjust while game is paused via timescale being stopped / equal to 0

553 views Asked by At

I have a settings menu in my game, where I have different audio (background music, dialogue, etc) where I can adjust the volume manually.

This happens during pause, so you can hear the volume and set it to your preference.

This was working fine, then one day, it stopped, and I haven't been able to figure out why.

All I know is that the volume of the audioSource DOES update, but the "actual" audio stays the same volume "until" you unpause (set the timescale back to 1) then it changes to match what the variable in the AudioSource says.

To emphasise, the value "does" update, but the real sound stays the same until you unpause. How can I hear the sound change while the game is paused?

The fact this seemed to work before, suggests an update or change in setting may have broken it, but may also be able to fix it? Otherwise I just have to not use timescale for pausing, or move the volume control settings outside of the pause mechanics

Thanks in advance

1

There are 1 answers

0
hijinxbassist On

This may be caused by the audio mixers updateMode being set to AudioMixerUpdateMode.Normal.

Changing the updateMode to AudioMixerUpdateMode.UnscaledTime will ignore Time.timeScale and update the audio mixer in real time.