Hi All,
I have experienced some interesting behaviour whilst attempting to optimize my game and I was wondering if anyone had the same experience. Essentially, at the moment I have removed the FPS cap for the application (I have set Application.targetFrameRate = 300), however fixed update is set to a fixed time of 50fps (0.02 seconds I believe).
During testing, with vsync switched off often my game will hit 150FPS continuously, however occasionally (say once every ten seconds, but seemingly randomly) it will lag for ~1 of a second down to, say, 45FPS. Looking at the profiler output it seems that Physics processing is kicking in.
If I set Application.targetFrameRate = 60 then the lag does not occur in testing. I have tried turning of auto sync transforms and running a manual sync in LateUpdate after each frame.
I am wondering if there is some sort of scenario where if the Update FPS is much higher than the Physics FPS the system occasionally needs to do an expensive operation to “catch up”? Looking at the task manager whilst the “catch up” is occurring then GPU usage is right now but CPU stays high.
Thanks in advance for any help on this!