I recently moved my Visual Studio Code application from the Downloads folder to Applications (So I could update it, as it won’t update when in the Downloads folder). But now when I double click a script in Unity it won’t open, how do I get this working again? Does it have something to do with the change of file directory?
Sounds reasonable. Your Unity setup includes a path to the code editor, I assume it is pointing to where it used to be. Check Edit/Preferences/External Tools/External Script Editor
I’m in External Tools, it looks like Unity still has VSCode as the script editor. Is there something else on the page I need to check?
Edit: I reset the argument and now everything’s working again (except errors still aren’t being highlighted when I make them).
I’ve already installed Mono but VSCode keeps asking me to install it, does that have anything to do with this?
This would be something that the folks who support VSCode (and the Unity Extension) will have to answer. I use VSCode for lots of things but Visual Studio Community for Unity. It’s free perhaps give it a try.
With the new Unity extension for VSCode, there is no need for mono anymore. My guess is that you are using an old C# extension (v1.x) in VSCode. Please make sure you are using the following versions:
Extensions in Unity:
- VS Editor Package (v2.0.20)
Extensions in VSCode:
- C# (v2.0.320)
- C# Dev Kit (v0.4.2)
- Unity (v0.9.0)
Then make sure VSCode is set as your preferred Editor in Unity. You should have something like this:
Thanks guys, my error detection is working again
Perfect!