How to get Visuial Studio Code working with Unity

Hey, I recently got into making games with Unity and needed a better text editor. I read online that VSC was the best, so I decided to use that. I followed a tutorial on Reddit, however the one from the AUR does not have extensions for unity, so I downloaded the Snap version instead. I also installed MONO and .NET with the commands in the post.

This is where the problems start, I am unable to Force Programs to use MONO, because I am do not have permission. I can also not set the Snap Version of VSC to Unity, only the AUR one. I can edit scripts with VSC (Snap) only if I open the folder from inside VSC. Also autocompletion does not work, even with .NET Installed.

code seems to work fine for me, I have successfully installed and used the Debugger for Unity and C# extension with it. I installed Unity using unityhub, which I installed from the AUR. It might be the containerization of snap that causes some of the issues. I’d suggest trying code again from the repositories. And as far as I know unity bundles its own version of mono, at least the ones that you can install with unityhub.

By code do you mean Cod(patheon), if so should I switch from VSC to that. I’ve tried to get unity to work with vsc but I can’t get it to work and would rather use an AUR or Offical Reporsitary than a snap. I’ve also used atom before and I think that might also be a good option.

code is the name of the VSC package in the manjaro repositories.

code is the name of the package for Visual Studio Code in the Arch and Manjaro repositories.

1-Install .net runtime, .net core and VSC
a. Open Whisker Menu and type ‘Add/Remove Software’
b. In program, search .net and select .net core and .net runtime.
c. After, search code and select ‘Code-OSS’ and click apply

2- Install Mono
a. Open terminal and type sudo pacman -S mono

3- Set Unity external script editor to VSC
a. (In Unity) Go to Edit → Preferences → External Tools and set external script editor to Visual Studio Code
Insiders (bin/code)

4- Install C# Extension in Extensions

5- Set Omnisharp : Use global mono is Always,
a. (In VSC) Go to File → Preferences → Settings → Extension → C# Configuration in VSC and Set Omnisharp : Use global mono is Always,

After these settings restart Unity and VSC

Thanks a lot, it finally works!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.