Gravely need some optimization tips

I am making a game with a city of around hundred buildings.

  1. Majority of the buildings are there
    as it is
  2. Others are enabled/disabled at
    runtime.
  3. 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.

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.

Hi nikrath,

Unity has a wonderful page for exactly this! I didn’t know this until now. Hope this helps other people as well:

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.