- Home /
Unity 5 stuttering
Hi guys, i have a problem. a constant stuttering of the game in play mode AND in editor mode(if i move the camera in editor mode, it will produce micro stuttering too). i dont know what to touch, what to change to eliminate this stuttering. This Stuttering appears at a fixed amount of time while in play mode, lets say ever 0.5 sec and the FPS drops from 2500 to 200 and even 40, very noticeable the micro freezes. In editor it appears when changing direction of view or pressing keys.
so far i have tried:
-Restarting the editor
-trying 64 and 32 bits
-disabling Vsync in the editor, in the Nvidia panel and both at the same time.
-Nvidia Drivers updated
- i have Windows 10 Pro 64bit, I5 4690K, GTX 970 SSC, 8Gb. i tried on my old Win 7 too with the same rig.
- I suspect, in play mode, it is something related to FixedUpdate, but it only has this line of code:
void FixedUpdate () {
rigidBody.MovePosition (rigidBody.position+(velocity*Time.fixedDeltaTime));
}
In the profiler you can see spikes of 99% use of the processor by the physics engine.
- I have readed other forum posts related to this problem but i havent found a solution yet.
Here a video in play mode with the profiler
https://youtu.be/CDp62AYCnK0
HEre a little video of the stuttering inside the editor, not in play mode. https://youtu.be/cW4vAZbTmFQ
Does it happen in a tiny demo project? A really huge scene but with almost no scripting? When did it start? If you remove that line you suspect, does it still happen? It could be your computer, or your project is doing something to cause it ... . Seems you just have to narrow it down.
Thanks for reply. It happens all the time, no matter the project. in the video example, it is a new project just to show you the problem i am facing. but it happens all the time. Some rarely times it doesnt happen. i am using a completly fresh Windows 10 installation, all updated including the drivers. it happened in Windows 7 too. It started since i installed unity 5 some months ago, it is just that i am tired of this happening in all my projects. I have some experience in unity, not thaaat big but i know more or less what i am doing, and it is very anoying not knowing what is going on here. If i delete the FixedUpdate it will happen no matter what. The worst is that it happen even when i am not in play mode. I am not using any external assets, nothing at all, just a couple of spheres, cubes, a plain. 3 materials with simple albedos, the sun light and thats it. Just for the record, the CPU and GPU temps are perfectly fine, i play demanding games without problems. Is there any kind of logs that i can check somewhere? i am at the point that i dont know what else to do :(
GFX.WaitForPresent is the responsible of the constant spikes, using like 50 or 60 ms at 99%
i can confirm it has nothing to do with FixedUpdate since i disabled the script using FixedUpdate and the problem still persist.
Adding more info to the problem. It is confirmed that the stuttering keeps happening even with an empty scene, the micro freeze happen exactly when a any key is pressed. FPS drops from 2000 to 15-19
Answer by zorksox · Jan 26, 2018 at 06:38 AM
Try using "Exclusive Mode" in the player settings. This fixed it for me. Here is a video that outlines a bunch of potential fixes. Fixing Unity Stuttering
Your answer
Follow this Question
Related Questions
Reduce Physics2D Lag 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How can I change friction of a Physic material in script? 1 Answer