- Home /
Bad Performance on Mobile.
Hello, I have created a very simple 2d game for android (tilt device and hit randomly spawning power ups). I have used all mobile shaders, all textures are either 128*128 or 32*32, and Quality is set to 'fastest' with no vsync and half size rendering.
The game runs on my android (HTC One) at a constant 40-65fps which is not too bad however the game seems very slow. Even though the frame rate is fine, the game just seems sluggish and a bit jumpy and laggy.
I do not understand why this is happening, i believe everything is optimised correctly. Any help is appreciated. Thank You.
You likely have some intensive code running (nested ifs, while loops, large coroutines) and/or a lot of NullReferenceExceptions. In editor, Debug.Logs will have the same effect.
After fixing your errors go through you scripts one by one.
meat: Don't errors crash builds? I only run iOS, and any "red" error is always a complete crash or permanent freeze. But maybe android is different, and errors recover and slow you down.
But, yes, it could be anything. The usual way is to always be testing, so you see right away what causes lag. With a finished game, you could reverse-test: ideally you could make buttons in the game that disable enemy AI, stop spawning particles... , and keep turning them off until you see what caused the slowness.
Failing that, make a new project with a bunch of things taken out. If it runs fast, add them in one at a time. If it still runs slow, take out half of what's left. Big pain, but using different platforms always is.
Also, try to get a feel for when it happens. Like only after you destroy a ball ... .
Your answer
Follow this Question
Related Questions
Performance problems on Android (apk) 1 Answer
iPhone 4 game lags 2 Answers
Unity to android (game very laggy) 1 Answer
Mobile performance tips 3 Answers