0

I have created a game in unity, using an orthographic camera. Occlusion culling is enabled. Rendering path is forward.

As a player you see a part of the level. You go to the right to progress through the level. The level is quite long.

The problem is that the longer the level is. The more laggy it becomes. In order to reduce the lag, I have tried disabling a part of the level this worked. According to the profiler, the scripts are not causing the problem, but the rendering of the objects is. I have optimized all code. None of the gameobjects (besides the player) is using the update/fixedupdate function.

I thought the camera automatically disables rendering gameobjects outside the camera view? (It is what I heard). According to what I am experiencing right now, it seems I am missing something.enter image description here

enter image description here

Tuyen Phan
  • 43
  • 1
  • 7
  • 1
    yes, the game view only renders what the player sees, but you also have the scene view open. Try running the game Maximized and you will notice a big improvement – Daahrien Oct 02 '18 at 19:52
  • Have you set up the occlusion areas right and baked it? – Ryolu Oct 03 '18 at 01:43
  • In addition to what @Lestat said, make sure you don't have a lot of Debug.Log outputs as well. – Adam B Oct 03 '18 at 05:05
  • A lot of my gameobjects had rigidbody's on it. The further I got into the game, the more laggy it became, because objects with rigidbody kept spawning. And Occlusion culing does not disable physic related stuff. So the rigidbody's kept stacking and stacking. – Tuyen Phan Feb 27 '19 at 21:22

0 Answers0