- Home /
android game is laggy
hi,i made a 2d game but its jerkish and laggy somethimes,below I provided images of my profiler below,please check it out and help me with the lag!! Thank Youalt text
it seems to be scripting problem the profiler show a high cpu usage with script part so enhance your code :
avoid instantiate & destroy objects and use object poling ins$$anonymous$$d.
avoid adding unnecessary code in Update function some codes don't need to be tested each frame example updating score text can be done only when score is increased code.
try to find the shortest simplest ways of coding search online and compare with your code.
Answer by TheSOULDev · Aug 16, 2017 at 05:08 PM
Your scripts seem to be the problem. Optimize it by making everything in update functions a coroutine that doesn't run every frame but a set interval (for an example I run checks every 0.15s for things like player location), don't make your scripts run everything at one point but divide it equally during runtime.
Answer by screenname_taken · Aug 16, 2017 at 06:21 PM
Simply click on the spike. It'll show you how many ms each object, script, physics need. Just see which one needs the most.
Your answer

Follow this Question
Related Questions
How do I prevent / deal with input lag on a touch interface? 3 Answers
GoogleVR vs GearVR - frame dropping 0 Answers
Unity to android (game very laggy) 1 Answer
Build game moves incredibly fast and blurry 0 Answers
Bad Performance on Mobile. 0 Answers