2D game. I was having an issue where my character’s rate of gunfire was slowing significantly when I was aiming quickly. Eventually I narrowed it down - Unity’s FPS drops significantly if you click-and-hold the mouse button and quickly move the mouse cursor. Tested this with a brand new project, I have the console Debug.Logging Time.deltaTime. You can see the time sharply rise while moving quickly and holding the mouse button. Oddly enough, the Stats window claims the FPS rises…
The difference between 500 fps and 300 fps, expressed in milliseconds, isn’t that much. The problem with using FPS to measure performance, from a mathematical perspective, is that it is non-linear. https://www.mvps.org/directx/articles/fps_versus_frame_time.htm
I tried a standalone actual build for the test scene, and it run excellent, so that seems to have solved it for the end user. I guess something with fast mouse movement combined with a mouse button causes some big overhead with the Editor - thank you for the suggestion!
It still concerns me because the issue wasn’t a drop from 500fps to 300fps, it was going from the appearance of like 60fps to like 20-30. The stats window in the video I posted has confused me with its FPS, or was talking about some other type of FPS, because with my actual game the FPS window was claiming a similar story - 90ish FPS before fast mouse movement + click-holding, and then 190ish FPS while click-holding and fast movement. But before the mouse movement, my character would jump very smoothly (claiming 90ish FPS); as soon as the fast mouse movement + click and holding, its movement was noticeably choppier, and was only spawning about half of bullets that should spawn (claiming 190ish FPS), which noticeably would affect gameplay.
The reason then I have concern is since fire rate affects the gameplay, I’d rather not have to export a whole build in order to properly test gameplay?
That did it!! Lowered my mouse’s response rate and that nailed it. Fortunately my mouse has profiles I can switch to on-the-fly, so 1 button hit and I’m set. Thanks mgear!