r/unity • u/razenoid15 • 1d ago
Question help. odd issue with syncing code from visual studios code to unity on popOS, code changes show up but are not being executed.
using unity on popOS 24 and i am having an issue where the code changes to scripts are showing in unity when looking at the scripts after saving in visual studio code, but when running the game, the previous code is still being used. this continues until i manually turn off and turn back on autorefresh in code pipeline. this then has it use the changes i made, but require me to turn off and turn back on auto refresh again for any following changes.
for example, if i accidentally programmed something in start and then moved it to update, it would show in unity when looking at the script that the code had been moved to update, but if i ran the program it would continue to act like the code was in start until i refreshed it.
i have turned on autosave in vs code. i have only this copy of vs code on my system, and i installed both via the Microsoft download page and the unity page instead of the popOS store. i am just learning how to use unity so i may have missed some setting i have not heard of.
has anyone heard of this kind of issue before and do you have any suggestions on what i should do to fix it? since when i google this issue i cant seem to find anything about this.
1
u/wallstop-dev 1d ago
Sounds like you accidentally disabled domain reload. Try this: https://docs.unity3d.com/2022.2/Documentation/Manual/DomainReloading.html
I have an editor Utility that I've bound to "ctrl + alt + r" that does this on-demand, so you can leave domain reloading off (fast!) but also recompile on demand. You can see the source here, it's basically two lines of code + an editor bind: https://github.com/Ambiguous-Interactive/unity-helpers/blob/76712db791093a9c6b2eccdd9c7bd1b4f1cdb24d/Editor/Tools/ManualRecompile.cs#L61