- Home /
Gravely need some optimization tips
I am making a game with a city of around hundred buildings.
Majority of the buildings are there as it is
Others are enabled/disabled at runtime.
All buildings have been marked static
When I started out, I had a camera view distance of 100 and maybe 10 buildings. I was getting smooth FPS on mobile. Now, I added around 50 buildings, still fine. But I went up to a 100 buildings, and I faced a major drop in FPS. I don't understand how this happens, because I have occlusion culling going on, and the view distance is still the same. So effectively I am rendering only 10 buildings at runtime, but still a huge drop in FPS from before. P.S. I even made the camera top down, so I had now only 2-3 buildings in scene, plus only 30 batches. But still no change. Any help is appreciated.
Try combining the meshes of several buildings to decrease the amount of GameObjects.
Answer by nikrath · Jul 18, 2017 at 09:13 PM
Ok I solved the issue, which was basically a NullReferenceError being produced by a script every frame. The editor handles those issues fine enough, but it was really slowing down the mobile.
Answer by LocalNoob · Jul 17, 2017 at 12:04 PM
Check out the profiler(But I am sure you already did), also try turning off vsync, it is somewhere in project settings, it drops fps significantly.
Answer by Cornelis-de-Jager · Jul 17, 2017 at 12:40 PM
Hi nikrath,
Unity has a wonderful page for exactly this! I didn't know this until now. Hope this helps other people as well:
https://docs.unity3d.com/Manual/OptimizingGraphicsPerformance.html
Your answer
Follow this Question
Related Questions
[Android] Debug vs Release build FPS 0 Answers
How to improve FPS on mobile? 1 Answer
Is the new cloth component compatible with mobile devices? 0 Answers
Does This Support Mobile ? 1 Answer