Big Spikes Camera.renderer / Gfx.WaitForPresent
Hi Guys! I got a problem and hope you help me to solve it out. My project is endless 2D platformer and I got annoying spikes every frame or few frames. Same for PC/Android/iOS devices. I adding profilers data, seems like the problem is in Gfx.WaitForPresent in CPU profiler and Camera.renderer in GPU profiler. I tried lot of things, deleted all of my backgrounds, turning of paralaxing, changing player movement system, turning on/off VSync, setting Skybox to solid color etc. but the issue still comes up... I'm still in learning process so if someone could give me some advices I would be very pleased!
Answer by RicochetShooter · Sep 10, 2015 at 10:44 PM
Two main reasons are: you are too fast - refresh rate is 60hz and you are ready after 10ms - 6ms you need to just wait you are slightly too slow - same as before - but you are ready after 20 ms - you will wait 13 ms (up to 33ms = 30 fps)
Try setting Application.targetFrameRate = and see if that helps, also you can turn off V sync in quality settings.
Thanks played a bit with Vsync options and modified my targetFrameRate script and now everything looks smooth and shiny.
In case anyone with a laptop gets here, this also happens when you aren't telling your laptop's geforce to render Unity (using integrated ins$$anonymous$$d). Just add Unity.exe to your nvidia control center apps and set to nvidia.