My situation is I load the menu game runs great, then I load the 1st level game is fine, but if I go back to the menu from the game there’s all of a sudden a gigantic hit on the physics.processing, physics2D.FixedUpdate, Physics.Processreports, Physics.FetchResults, Physics.Simulate, Physics.UpdateBodies and AudioManager.FixedUpdate. These all add up to like 3k ms but I can’t seem to figure out what is causing this. I’m also using hotween and playmaker if that makes any difference but generally when I haven’t seen many issues when I load a new scene which was working fine the 1st time it’s loaded.
If I look at the profiler all the objects are N/A and the physics section shows 0 objects in physics and physics 2D.
The profiler shows you the amount of FixedUpdates that occurred last logical frame. So, if you got a frame heavy with graphics, or with logics, there could be more than one FixedUpdates shown per the frame. That’s expected since FixedUpdates are always called on a fixed frequency basis with exactly the same value of fixedDeltaTime. So, if you had a lengthy operation like a synchronous scene load from within Update(), the time would get advanced by a larger value, like a couple of seconds, so FixedUpdates will be called several times to catch up with the real time.
Is it really the case where you’d try synchronous LoadLevel on a heavy scene? If yes, then I’d recommend switching to asynchronous loading, as that would unfreeze your game and let it run smoother. That’s especially useful if you want to be showing process bars that reflect the scene loading process.
I am currently working on a simple mobile game and have encountered a similar problem. The first level I load with SceneManger.LoadScene runs great but if I restart or load another level my performance suffers similar symptons (albeit with smaller values). Did you manage to fix your problem, in that case how?
You were right! Wow thank you, I thought that the time settings would be reset when a lvl was loaded. For anyone curious; fixed the problem by setting the Fixed Timestep to the inspector value with the following: