Low performance on Mobile build of 2D Platformer game.
Hello People. I'm having serious problem with mobile build performance. when i run the build in my mobile the frame rate is too low. And when i run the PC Build on laptop it uses 14-16% of CPU. My game is minimalistic when it comes to sprites. Actually i wanna also ask is there any way in which i can run the Objects that are only on camera view instead of running all objects in the scene. I tried Occlusion culling "I baked the objects and run it works fine as long as i'm in occlusion tab but when i switched back to inspector tab the frame rate dropped again. I have tried my project on unity 5.3.3 and 5.3.5 Personal Edition. Please help we have almost finished our project but it is running very slow and taking much CPU usage.
I have attached the screen shot with profiler - VSync on and off.[Image1 Vsync on, Image 2 - VSync off]
Answer by itsharshdeep · Aug 04, 2016 at 03:29 PM
HI, I an not very great with the profiler and such things.. but did you tried to check some of the following listed items:
How much code is in Update Methods.. Are they too much & Unnecessary ..??? Can that code can be modified to non-update methods
Are you using the sprite packing.. If not then do that also ?
Your Graphics assets are too high resolution for normal mobile devices ??? Like more that 1024 ( except BG) if yes then do compress. NOTE : NOT TO COMPRESS THE GRAPHICS IN UNITY. YOU NEED TO REDUCE THE SIZE OF THE GRAPHICS OUT SIDE THE UNITY
What type of Colliders you are using ? Can you use normal box & circle colliders in most of the places where you have used Polygon collider
Are you using pooling in your game or not for the obstacles and placements. If not then do that instead of the re-spawn and destroy.
Can you spawn most of the thins spawn when needed? Like Screens and extra gameObjects. No need to place disabled the objects in hierarchy, do spawn them from Resources when needed
Are you setting up the target frame in any script. Do you really need that??? what is the effect on the game with/without that line?
Your Physics and Rendering line is at top most ... Can you please cross check by disabled some of your graphics stuff.. do this process until you find out what things are taking high peeks.
Do set the setting of the Graphics wisely like where you need TrueColor, Compressed, MinMaps etc etc
Hope any of the point work and your game will get high FPS. These are all currently in my mind. I think in case if any of this didn't work the you need any other alternate or code review.
Thanks