Visual Studio code does not open .cs scripts from Unity correctly

In Section 1 Part 6 of Complete C# Unity Game Developer 2D we are tasked to create a simple .cs script in Unity and open it with Visual Studio Code.
I have VS Code set up and made all the settings as in Part 4 “IntelliSense Issues?”, but when I double click .cs script in Unity to open it I am presented with this window, and not the script itself:

https://imgur.com/ipslAiH

So to open actual script I need to find it in left collumn and manually open it from there, which is not very convenient.
Can this be fixed or is it a normal behavior for VS Code?

Hi,

Is Visual Studio Code selected as your External Script Editor in Unity (Edit > Preferences > External Tools)?

And which version of VS Code do you use? One of the recent versions did not work well with Unity.

Yes, VS Code is seleted as External Script Editor in Unity.
The version of VS Code is 1.64.1

Have you already tried to uninstall and reinstall VS Code?

Not yet.
I’ll do that later and let you know if that helped

So completely uninstalling and reinstalling VS Code didn’t helped, I still get several empty windows opened when I open .cs script in Unity

Install and use Visual Studio (Community Edition). For some students, VS Code simply does not work well. Maybe due to a problem with Unity, some update or whatever.

  1. Download VS and follow this instruction.
  2. Select VS as your External Script Editor in Unity (Edit > Preferences > External Tools).
  3. Install the “Visual Studio Editor” package in the Package Manager.

Maybe VS will work.

Is Visual Studio (Community Edition) differs heavily from VS Code?
I follow the course thoroughly and everything is made there with VS Code. I am completely new to coding and creating something in Unity or making games in general, so this course is basically my entry point into this kind of stuff and I’m kind of frightened to mess something up using different kind of software :slight_smile:

No, it looks almost the same. As for me, I prefer to write C# code with VS because I’ve used it for many years. I mainly use VS Code for web development. Both script editors are fine, though.

Feel free to test VS. If you don’t like it, you could try to fix VS Code. :slight_smile:

Okay, I’ll try using VS, thank you for your suggestion!

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

Privacy & Terms