Marvin Nwachukwu
Marvin Nwachukwu

Reputation: 11

Vs code won't open automatically with unity

I'm having a problem where I switched to VS Code cause it's lighter, but my Unity C# scripts won't open automatically with VS Code.

I've made sure to change the external text editor to VS Code in Unity and even installed both Visual Studio Code editor and Visual Studio editor, but nothing changed.

And I've made sure to install the necessary extensions in VS Code, but when I click a script in Unity, it doesn't open up in VS Code. I've gone to VS Code and confirmed that the script is editable within it too... Please does anyone have an idea why it won't open automatically?

Upvotes: 1

Views: 52

Answers (1)

MHMD
MHMD

Reputation: 564

  • Make sure your Unity version is 2019 or newer.

  • Install the VS code package in Unity:

Here is how:

1. Go to Package Manager

1

2. Select Unity Registry

2

3. Search for Visual Studio and select Visual Studio Editor.

Ensure you choose the latest version, & don't select Visual Studio Code Editor since it's old.

4. Go to Unity > settings, or if in Windows: Edit > preferences

5. Select External tools and in External Script Editor: Select Visual Studio Code

If you don't find it press on brows and brows for Visual Studio wherever you installed it, if it's in the default place then it will be in: C:\Users\{Username}\AppData\Local\Programs\Microsoft VS Code

6. Click on Regenerate project files

Now you should open your C# projects in VS Code.

  • Note: Make sure you install the Unity extension in VS Code, and restart it.

I hope that helps.

Upvotes: 1

Related Questions