Search Unity

Bug Compiling Scripts Randomly took way longer.

Discussion in 'Scripting' started by ch1mp_, Jul 20, 2022.

  1. ch1mp_

    ch1mp_

    Joined:
    Jan 25, 2019
    Posts:
    2
    I am working on a very small project, only 1 scripts as been added so far with barely even 70 lines of code in it. However upon trying to test a small change I made once, it took far longer to compile the scripts when I returned to unity, giving the little "busy for 1s, 2s, (ect)" and even taking upwards of 2:00 to compile 1 script, which is the only script in the entire game so far. I have no extra add ons installed, it worked previously during the same project, doesn't seem to be using any extra resources, as it stays below, 10% cpu, ram, and gpu usage, I have tried disabling my anti virus, but that has been the extent of what I've tried before consulting the forum. I would like to keep working on the game, however because of this problem progress is not only slow, but also very frustrating, so if anyone has an answer as to how to fix this it would be greatly appreciated.

    Thank you
     

    Attached Files:

  2. Jean-Jacque_Jiquenschwees

    Jean-Jacque_Jiquenschwees

    Joined:
    Jul 18, 2022
    Posts:
    29
    I guess you just have bad internet try restarting your internet router or just wait.
     
  3. mopthrow

    mopthrow

    Joined:
    May 8, 2020
    Posts:
    348
    If it's wasting a lot of your time, it might be less painful to make a new project and transplant the assets over.

    I hope someone knows of a good solution, but in the mean time you have one script so it should be fast.
     
  4. Nefisto

    Nefisto

    Joined:
    Sep 17, 2014
    Posts:
    333
    Which version of unity are you using? The last versions of unity (2020-2021) are struggling with this problem, it happens to me but just sometimes, AFAIK we don't have a way to "fix" this, but as you have basically an empty project, try to recreate the project copy/paste your code and try again, maybe this helps. One thing that is helping me to minimize this problem is manually triggering the compile, so you will not face this every time that you change the context from IDE to editor (you can change it on settings). Hope this helps
     
    ch1mp_ likes this.
  5. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,841
    Um what? Script compile times have nothing to do with internet speeds/connection.

    OP, yeah this happens and is a bit of an issue with Unity sometimes. I would turn off directory monitoring and Auto Refresh, as most of the issues I've encountered are due to it auto-compiling.

    I would also remove any packages you're not using, such as the packages for any of the IDE's you're not using.
     
    ch1mp_ likes this.
  6. ch1mp_

    ch1mp_

    Joined:
    Jan 25, 2019
    Posts:
    2
    I very much appreciate the suggestion, I'll definitely try this but it does seem that its probably just unity not functioning properly.

    Thank you again
     
  7. SolidSign

    SolidSign

    Joined:
    Oct 22, 2021
    Posts:
    6
    Did you find any solution?