- Home /
Mobile Game starts lagging after a while when playing on my phone!!!! Pls Help!!!
Hello all,
I have a finished game that I want to release on Google Play. I downloaded the .apk to my phone using unity and did some play testing. I found that the game would start LAGGING over time. In the beginning, I had around 60 fps (used "Application.targetFrameRate = 60"). After playing a couple of rounds of the game (it is an endless runner) the frame rate dropped all the sudden and reached about 35 fps and became unplayable. When I had quit the application and the started it again, I once again only had 35 fps. If I quit and force it to stop, then start it again I also only have 35 fps as before.
If I close the game, and wait 5 - 10 minutes just doing other stuff on my phone, it goes back to 60 fps when I start it again.
This is so weird. I don't understand how the lag can just appear and then persist when switching scenes and restarting the game even.
Someone please help me, I am completely clueless!!!
I think that this might have to do with the fact that my phone is heating up and thus loosing performance. That might be the reason why it returns to 60 fps if I let it sit for 10 - 5 $$anonymous$$utes and also why it starts lagging "gradually". I did an experiment where I ran the game until it lagged, then put my phone in the freezer for 1 $$anonymous$$ute, and voila, I had 60 fps again. This is probably because it cooled down.
I looked into the profiler and found something interesting. Apparently something called "Semaphore.WaitForSignal" is using 18 ms and 65% on the cpu. It suddenly appears for no apparent reason
Answer by lazybitkings · Jul 01, 2020 at 09:28 AM
I solved it!
I changed my fixed timestep from 0.5 to 0.01333 which eliminated the lag
Your answer
Follow this Question
Related Questions
my android game lag sometimes 0 Answers
How many sprites is too many sprites for mobile? 0 Answers
Android lag 0 Answers
Many sprites need to load on mobile devices in unity3D 0 Answers