Search Unity

Lagging game in editor and in EXE although the computer is fine

Discussion in 'Editor & General Support' started by spinmaster98, Jan 22, 2020.

  1. spinmaster98

    spinmaster98

    Joined:
    Jan 22, 2020
    Posts:
    2
    Hi everyone. We are 2 person indie game developers and beginners to unity. We are trying to create a corridor with rooms on both sides. As level designer, i created the room contents in blender (desk, bed, wardrobe) and an empty room with just walls. I imported the empty room into unity then added the room contents. Then i copied the room and the contents multiple times to make a corridor. The problem is when there is a single room (with all interiors) there is no lagging but when i start to copy the rooms, the lagging beggins and eventually with 13 rooms in hand it lags like hell both in editor and when i play the game. I must add that the objects and the room are real life-sized. I also thought about if the textures could lag the game since its a 4k texture and i tried the game with no single textures (there is just 1 texture anyway) but it didn't help, still lags like hell.

    My pc specs are:
    - Nvidia GTX 965m
    - Intel i7 4720hq

    I don't think the game should lag on these specs. We haven't done anything yet.

    The other problem is the exe i took is not lagging just on my pc but my friend's pc too which has GTX 2070. Shouldn't his pc run the game smoothly?

    How can we fix this lagging?

    Here's a photo of the corridor
    Ekran Alıntısı.PNG

    Thanks in advance.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Check what the profiler says is the source of the lag. It is hard to say just looking at the picture.
     
  3. spinmaster98

    spinmaster98

    Joined:
    Jan 22, 2020
    Posts:
    2
    The source is rendering. The peaks are when i start to walk across the corridor and looking to the corridor side from inside the room. Lower parts are when i'm inside the room and looking through the window side. What does this mean? How can we deal with this intense rendering? Ekran Alınastısı.PNG
     
  4. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    How many batches is it rendering at its max? You may have too many objects with unique materials/textures being rendered at the same time.

    Look into batching them, and/or using Occlusion Culling to only render a portion of the scene at once.
     
    Joe-Censored likes this.