Search Unity

Random frame drops on start

Discussion in 'General Graphics' started by MikeyJY, May 26, 2020.

  1. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    Recently I posted a thread about bad performance:
    https://forum.unity.com/threads/how...-to-enable-gpu-rendering.897971/#post-5898581

    It looked like no lag in the game anymore, but I encountered something weird. When I enter playmode, sometimes no lag, sometimes it is very laggy. That happens when I change something minor as you can see in the following video. I started the game 4 times. First, no lag. After I changed a collider position and it started to be very bad. At the third run I changed an orange position and lag again. After that I disabled and re-enabled an random object form hierarchy and no lag again:


    I also have 26 errors in console, but I said that I'll solve them later but I would like to know if they may be cause this "random" lag:
    upload_2020-5-27_0-49-27.png

    upload_2020-5-27_0-49-33.png

    And another shord question:
    What do you do when you feel demotivated with your project?
     
    Last edited: May 26, 2020
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,457
    You are showing the logs as "Collapsed". That's not 27 but ~2.3 thousand logs. And yes, that will cause a lag.
     
  3. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,457
    Untoggle collapsed and Clear the console before you start and then see how the logs coming in correlates to the lag. Also, the Profiler should show how costly the debug logs are and wherever else there might still be room for improvement.
     
  4. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    Thanks, now I have only 2 collapsed errors that I can't solve but no lag anymore, thank you.