- Home /
2D Game stutters
Hello, so I've been searching around to find a solution, but sadly I couldn't find one, so I'm wondering if I would be able to get help here.
My game stutters every now and then and I can't seem to figure out why. There are very few objects on the scene and everything are made of sprites. I checked the profiler to see what could be the problem, and I see that every time I stutter, It shows a lag spike. I found that something called Gfx.WaitForPresent seemed to be the problem. I read online that it's got to do with VSync and whatnot, but I was not able to find a solution.
So I'm wondering if anyone's able to help me find a solution to my game's stuttering? If you need any clarification or my current project, feel free to ask!! And here's a screenshot of the profiler:
$$anonymous$$aybe you can upload your project, so we can figure out what is going on?
Try what Harshad$$anonymous$$ suggested:
Application.targetFrameEate = 60; // (or 30)
Also have vsync disabled in quality settings.
http://answers.unity3d.com/questions/690132/what-is-gfxwaitforpresent.html
Thank you for the replies!
$$anonymous$$ethods I've tried:
-Turning VSync on, was already on when it started stuttering/hiccuping
-Turning VSync off, still the same problem
-Turning VSync off with Application.targetFrameRate = 60;, still stutters***
***However, after turning off my computer and going back this morning, the intense stutter seemed to have disappeared..
So I'm not sure if it's just on my side, but I will link the Build. I will continue to keep an eye out for the stutters, but the Application.targetFrameRate = 60; seemed to ease the problem by a bit.
As a side note, are there any tips for optimizing for 2D sprites that you guys can give a beginning like me?
Build: https://www.dropbox.com/sh/8esw3af8q8mplws/AABf9AvTZeprjLqO9TJCBjLSa?dl=0
Your answer
Follow this Question
Related Questions
Unity 5.1.1 Transform Lag/Bug 0 Answers
Can I measure the users connection speed? 2 Answers
Mysterious stuttering! 'Unaccounted' 3 Answers
2D Animation does not start 1 Answer