Slowdown When Reloading Scene in Unity 2D 2020.3.25f1

I made a simple script that’s supposed to reload the current Unity scene upon the player’s death. (It will also delete previously defeated enemies up to the most recent checkpoint.)

However, I’ve noticed an issue that, when reloading, the scene seems to run slower. There’s no framerate dip, at least not on my end. But the Time.deltaTime and Time.fixedDeltaTime both seem to decrease.

Before:
9178979--1278341--upload_2023-7-28_18-52-20.png
After:
9178979--1278344--upload_2023-7-28_18-52-37.png

I don’t know why this is happening, and any help is appreciated.

There is no such thing as Unity 2D, only 2D features and components. I don’t see what the above has to do with physics nor do you show how you output the above so there’s little to comment on really.

The only thing to say is that Time.deltaTime is the frame-time, unless you read it from the FixedUpdate in which case it returns the same as Time.fixedDeltaTime. Note that physics doesn’t control this, 2D/3D or otherwise. Time.fixedDeltaTime is a global setting in the TimeManager again, not control by physics. It drives the player-loop which calls many systems in Unity, including but not limited to physics.

I’ll move your post to the Scripting forum.

Nevermind, I think I figured it out. If I’m right about the cause of the issue, then the problem was that when the player dies, the value of Time.timeScale was slowed down to create a more dramatic effect. However, when reloading the scene the slowdown effect was interrupted and was not corrected. This results in the scene reloading and still being slowed down.

The solution seems to be (for me at least) simply setting Time.timeScale back to 1 when reloading the scene.