Ok, so I have been working on a simple 2D game in which the player has to dodge cars that are spawned from the other end of the screen. The problem is I get random stuttering which shows up in the profiler as ‘unaccounted’.
This still happens even when:
building the project
having no other programs running
using different computers
I’m using object pooling for spawning the cars. Cars spawn time and position are calculated in a separate thread. The game uses 2D physics.
I can’t for the life of me figure this out and in it’s current state I can’t do anything with this game!!! Let me know if you need to see any specific scripts or anything. Thanks.
Okay, so I initially thought it might be a problem with my scripts or Unity itself. However I got the same regular stuttering when playing Battlefield 4 which suggested that something else was up. After looking into it I have discovered that it is a problem with Windows 10! It only affects some systems but to fix it you will need to disable the Diagnostic Policy Service.
So if you have this issue press Windows key + R and type ‘services.msc’. Find Diagnostic Policy Service in the list, right click on it and select properties, then under startup type set it to disabled. I did this and all of a sudden my game is getting 200fps!!! Not to mention this fixed stuttering in other games I play as well. For shame Microsoft, for shame
@lawrence-parry -(I can’t comment on your answer for some reason)
Unfortunately your solution didn’t work for me. I don’t think this has anything to do with windows. My project worked perfectly fine until I upgraded to Unity 5.4.1f1. Hope Unity fixes this soon.
In my case I was using standard shaders for android build. Switching to mobile shaders resolved the issue. Also do not forget to update unity