Hello, I’m currently working on a school gameproject and we are using Unity as our engine.
Recently we have had huge problems with FPS drops (down to 20 fps, when it logically shouldn’t go under 60, ever).
Today though, I found something really remarkable. If I start the profiler the FPS goes up to ~100 and there are no problems at all, no matter how much stuff we add.
When our FPS drops to around 30 we have about 1200 drawcalls and 2mill trices, which should be completely fine, but the main thread goes up to about 20-22ms. From what I understand the “main thread” is there to declare how slow the >code< is running at that time, and that’s fine. The strange thing is - if we move the camera away from the entities in our scene, the MAIN THREAD drops and we again get 60 fps. How is this even possible? It’s like we are “culling” parts of the code (which is impossible, since the entities in our game still behave even outside the camera).
What makes the profiler fix all our issues? It’s bloody annoying to know that there is a magical solution somewhere in the code for the profiler that takes care of all our problems for some reason.
Regards // Andreas.