Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Unity Editor UI freezing after script compilation and before entering play mode

Discussion in 'Editor & General Support' started by jedy, Apr 3, 2019.

  1. jedy

    jedy

    Joined:
    Aug 1, 2010
    Posts:
    579
    Hey all,

    I've noticed this a couple of weeks while going between OSX and Windows - the Editor UI freezes for a couple of seconds after compilation and after entering play mode. I went through a few hours of Unity development footage by different users and the issue seems to be universal.

    This freeze increases the compilation time on all of my projects while using Windows by roughly 50%. Adding in the play mode freeze, one iteration can be delayed by up to double the compilation time.

    Here's a video depicting the issue:
    * Notice when the mouse clicks get registered


    The compilation spinner is also freezing (the Screenpresso overlay hides it):


    I did an extensive test on the issue and here's what I've found so far:
    • Happens only on Windows (both 7 and 10 from what I've seen)
    • Doesn't matter if the project has one file or more
    • This seems universal across all Windows Editors (I manually went back all the way to Unity 5)
    • The freeze duration seems proportional to the compilation time (or just project size?)
    • This reproduces with even the deprecated incremental compiler package
    • Turning off unity collaborate, logging out, or switching from DirectX to OpenGL does not seem to affect it
    • Turning off Windows' Search doesn't fix it
    I've reproduced this using Unity 2019.2, 2018.3.6f1, 2018.3.0f2, 2018.2.5f1, 2018.2.0f2, 2018.1.6f1, 2017.3.1f1 and Unity 5. I'm using Windows 10, Version 1809. Intel i5-8600, GeForce 1060, 32GBs of RAM. Both Unity and the projects are located on an SSD drive.

    Any ideas are appreciated!

    Cheers,
    - Jordan
     
  2. Azirell

    Azirell

    Joined:
    Oct 16, 2015
    Posts:
    18
    I'm experiencing same issue.
    I have 2 work stations with same project. It flies on i5-4440 and freezes as hell on R5 1600 (CPUs are major difference between work stations).
    It did not happen before I've reinstalled windows (Win10 on both).
    All of your tested issues did not help me either. Hope it can be solved painless.
     
  3. Makkus

    Makkus

    Joined:
    Sep 14, 2015
    Posts:
    19
    Same thing for me. Unity 2019.2.21 freezes for 20-30 seconds after each script compilation. This is makes working with scripts really painfull.
     
    sebjwallace likes this.
  4. sebjwallace

    sebjwallace

    Joined:
    Feb 18, 2018
    Posts:
    6
    Yeah I reset windows a week ago. Since then the 30-second ui freeze after compilation sucks. Searching for a resolve.
     
  5. Makkus

    Makkus

    Joined:
    Sep 14, 2015
    Posts:
    19
    I managed to fix it form me. I did the following changes:
    I closed all additional window tabs (Package Manager, Asset Bundle Browser, Test Runner, Profiler). One on them was solwing down resposiveness substantailly. Now I try to keep them closed when not in use. Then I was left with the debug-freeze problem (documented somewhere in the froum: Turning on debugger can cause an additional 20 seconds UI freeze). This I could solve by deleting all breakpoints from VS Studio (Debug/Delete All Breakpoints). Now the editor responisvness is ok agagin.
     
    Azirell likes this.
  6. sebjwallace

    sebjwallace

    Joined:
    Feb 18, 2018
    Posts:
    6
    I know the fix now. It's the package manager - close that tab from your workspace. Every time you compile and return to UI the package manage reloads all the packages. Ideally Unity should only run that if the tab is open.
     
    jhugard and Azirell like this.
unityunity