We are delighted to announce that Visual Studio Code support for Unity is coming back in a new improved form.
In June our friends at Microsoft launched the C# dev kit, which gives Visual Studio Code users access to some of the powerful C# tools more familiar to full Visual Studio users. Today, they are opening a preview of the Unity Extension for Visual Studio Code which brings the Unity experience for Visual Studio into Visual Studio Code.
The extension supports code editing powered by Roslyn for better Intellisense and AI assisted coding, backed up by the Unity Roslyn Analyzers to give you code suggestions specific to Unity. It also helps with debugging, running in the Unity Editor or standalone players. Use the new āAttach Unity Debuggerā command in Visual Studio Code, and set a breakpoint to get into the VS Code debugging experience.
The new Unity Extension for Visual Studio Code is built on the same foundations as the Visual Studio Tools for Unity and the C# Dev Kit. It is also licensed in the same way as regular Visual Studio. This means it is free for individuals, academia, and open-source development, just like the terms that apply to Visual Studio Community. For organizations, C# Dev Kit and its family of extensions are included with Visual Studio Professional and Enterprise subscriptions, as well as GitHub Codespaces. Please refer to Microsoftās license terms for details.
Getting Started
The extensions require Unity 2021 or greater. All you need to do is to install the āVisual Studio Editorā package (version 2.0.20 or above) in your Unity project. Note that you should NOT use the deprecated version for Visual Studio Code. The new extension uses the same backend as the full Visual Studio. If you have the old package installed, itās best to remove it first.
Once the Unity side is ready, you can just install the Unity Extension in Visual Studio Code, which will bring in dependencies, including C# Dev Kit and C# extensions if you donāt already have them.
Donāt forget that you can also choose Visual Studio Code as your external script edtor in the Unity Editor preferences under External Tools.
If you want to learn more about this extension, and provide feedback direct to the Microsoft team, you can do that in the Visual Studio Code editor itself with the Help > Report Issue function. Also check out their blog for more detail on this release.