Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Unity stopped recompiling, there is a way to force recompiling?

Discussion in 'Editor & General Support' started by belwar, Mar 21, 2018.

  1. belwar

    belwar

    Joined:
    Feb 21, 2018
    Posts:
    5
    Good morning,
    a problem arised two days ago. Usually, when I made a change into a script with MonoDevelop and then go back to Unity window, it recompiled all the scripts.
    But now it does not happen every time. Sometimes it recompiles, sometimes not. Sometimes I have to edit and save the file twice to recompile, but sometimes I have to edit and save 10 times...

    Closing and opening Unity forces a recompile, but I can´t do it every time I make a change into a script. I tried to reinstall and update Unity but the problem is still there.

    I tried to delete "ScriptAssemblies" contents, with no result. In fact, the problem is the same in all the projects I have. Also I tried to reimport the script but is not recompiled.

    The tab in - tab out is detected because a "Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.081504 seconds" line is printed into the Editor.log, but no more lines.

    There is any way to force Unity to recompile the scripts? Or any way to fix the problem?

    Thank you!!

    EDIT: My question was wrong, in the Editor.log it seems to recompile, but the warnings are not shown into Unity's console. And the files used in the execution are the old ones.
     
    Last edited: Mar 21, 2018
  2. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    Check your preferences and make sure "auto refresh" or something like that is enabled.
     
  3. belwar

    belwar

    Joined:
    Feb 21, 2018
    Posts:
    5
    Yes, it's enabled. The problem is that sometimes it recompiles and other times not
     
  4. larry2013z

    larry2013z

    Joined:
    Apr 14, 2020
    Posts:
    36
    I have the same problem in Unity 2020.3.11
     
  5. Phil_Z

    Phil_Z

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    36
    You can force a refresh by going to Assets->Refresh Assets (or Ctrl+R in Windows Cmd+R on macOS). Sometimes the file system caches and doesn't notify our file watcher.