Hello,
When there’s a transition between scenes, I’m using white loading screen that fades in, load the level, and fades out.
My problem is that sometimes, the new scene opens a popup that pauses the game (Time.timeScale = 0). I’m fading out the loading screen with Time.deltaTime. You can see the problem.
I figured I would use Time.unscaledDeltaTime, but I get really weird results.
if I put this at the top of the Update method for my white loading screen:
Debug.Log("Time.frameCount: " + Time.frameCount + Environment.NewLine +
"Time.timeScale: " + Time.timeScale + Environment.NewLine +
"Time.deltaTime: " + Time.deltaTime+ Environment.NewLine +
"Time.unscaledDeltaTime: " + Time.unscaledDeltaTime+ Environment.NewLine);
I see some totally reasonable:
Time.frameCount: 391
Time.timeScale: 1
Time.deltaTime: 0.01656673
Time.unscaledDeltaTime: 0.01656673
But other times…
Time.frameCount: 396
Time.timeScale: 1
Time.deltaTime: 0.02
Time.unscaledDeltaTime: 0.2051583
Time.frameCount: 397
Time.timeScale: 1
Time.deltaTime: 0.3333333
Time.unscaledDeltaTime: 5.526389
Because of that, there is not fade out. It’s completely white one second, and then becomes instantly transparent.
This happens even when there are no manipulations at all of Time.timeScale… What is happening? It sucks that you can’t rely on it at all ![]()