Search Unity

Why are my Unity scripts compiling but not taking effect?

Discussion in 'Editor & General Support' started by annasmags, Jul 22, 2021.

  1. annasmags

    annasmags

    Joined:
    Mar 16, 2021
    Posts:
    3
    Hello, I am working on a Unity project (2019.4.12) using VSCode 2019. My project is built on top of a far more complicated one that someone else wrote, and it pulls from 3 remote repos, has a load of addressables, translates from haxe, and does a lot of other things that are a bit above my head.

    Previously I had been working with these 3 repos versioned in a VSCode workspace (that did not include versioning of my unity project file), and things were working smoothly. However, I recently uploaded my project file to its own repo on Bitbucket, and added that to my VSCode workspace as well (with a complicated thing where I had to add one of those other repos as a submodule in my Packages folder).

    Now whenever I edit & save my scripts in VS Code and click back into unity, they compile like normal, and the changes show in the code preview in the inspector, but the changes do not update when I run the project. The only way I can get Unity to recognize changes is to restart the editor entirely. I'm worried this has something to do with the git setup (at least that's when my troubles began) but I have no idea how to fix it. Please please can someone point me in the right direction about how to solve this?

    I have tried messing with the auto-refresh and external editor settings to no avail. Reimporting/resetting/refreshing the scripts in the project/inspector windows seems to do nothing. I have also experimented with downgrading/removing the VSCode package, but no luck there either.

    Please any guidance would be so appreciated!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,744
    First try a reimport-all.

    Then if that doesn't do it, try exit Unity and delete the Library/ScriptAssemblies folder in your project. This is the built DLLs made out of your code. Then reopen Unity.
     
  3. annasmags

    annasmags

    Joined:
    Mar 16, 2021
    Posts:
    3
    Thanks for your reply! Unfortunately, neither of those things worked. Are there any specific settings I should have had set before trying those things? Or removing the VSCode editor package (I saw some chatter related to this on another thread) or something?

    I also found a folder hiding in Library/PlayerDataCache/iOS/Data/Managed that contained suspiciously familiar files to those in ScriptAssemblies, so I deleted them. I found some random cache files from an obj/Debug folder in my root directory, deleted those too. Still no luck. Any more ideas?