Audio: gameplay snapshot / menu snapshot (each plays different music).
UI pause/unpause uses a coroutine to transition timeScale between 1 and 0 over a second.
Problem: User clicks pause button, snapshot transition to menu music starts, coroutine lowers timeScale to zero. When timeScale reaches zero, audio snapshot transition has not completed. All I hear is faint gameplay music (instead of full volume menu music).
Is there a way to transition snapshots unaffected by timeScale? Audio snapshot transitions and pause transition are all 1 second long.
@jamesk5 Thanks for posting this. I can see why Unity would want a transition tied to timescale, but it would be nice to have a bool/check on a snapshot or mixer that says it should not be affected by timescale since one of the most probable use cases for transitions is a graceful mute (which usually happens when the game is paused).
[UPDATE]
Something I saw on another post actually works for this scenario: set the timeScale to a value like 0.0001f, then use that timeScale value multiplied against whatever fade time you send to the TransitionTo call:
Just wanted to throw another solution in here. I wrote this code for my AudioManager class (though this is easily thrown into your own class), and it will transition over time between two snapshots - unaffected by Time.timescale. You can modify the “steps” variable to make it smoother (more iterations), and adjust it accordingly until it is smooth for your needs. Hope it helps!