1

I am new to unity and have recently started scripting, I noticed that my vscode 2020 doesn't autocomplete my c# scripts.

  1. I have the c# extension installed
  2. I have "Visual Studio Code" selected in the preferences in unity
  3. I tried a bunch of different extensions
  4. I tried to Regenerate Project Files With Different Checkbox Selected

but nothing works.

Then I downloaded 2019 version of vscode. Surprisingly, intellisense is working in vscode 2019, however it isn't in 2020.

What shall I do? Any help will be appreciated.

Meet Shah
  • 612
  • 1
  • 6
  • 13
  • Does it help: Edit-Preferences-External Tools-Regenerate project files – yasirkula Aug 03 '21 at 12:01
  • I tried that a lot many times, with different checkboxes selected, that too doesn't work – Meet Shah Aug 03 '21 at 12:05
  • Does reinstalling Visual Studio Code Editor package from Package Manager help? – yasirkula Aug 03 '21 at 12:07
  • Nope. Tried that. Not working. – Meet Shah Aug 03 '21 at 12:19
  • Thank You @yasirkula for helping me out. However I got the answer. You just can't. Unity doesn't support visual studio code, it only support visual studio community, and the latest version of vs community is 2019. – Meet Shah Aug 03 '21 at 12:26
  • Wait, that's not what I meant. Unity in the Package Manager also has a package for Visual Studio Code, so it might as well support it (I don't know how). What I meant with my answer is that with Visual Studio Community you are on the safe side, being installable through the Hub. – Francesco - FL Aug 03 '21 at 12:30
  • Okay. I get it now. Thanks. – Meet Shah Aug 03 '21 at 15:08
  • My colleague uses VS Code 1.58 with Unity 2019.4.28 and 2020.3.14. He said he has installed [Debugger for Unity](https://marketplace.visualstudio.com/items?itemName=Unity.unity-debug) but I don't know if it's necessary. Also see: https://code.visualstudio.com/docs/other/unity – yasirkula Aug 03 '21 at 15:27

1 Answers1

-1

If you want to use Visual Studio with maximum compatibility with Unity, install through the Unity Hub. (open the Unity Hub, go to the installations, three points, add modules, click on Visual Studio Community 2019 and install it)

It will install Visual Studio Community 2019 with its Unity package, also in the project's Package Manager you can download, if it is not already installed, the support package that Unity (Visual Studio Editor) updates regularly, and which guarantees compatibility with Unity.

If you want to use only Visual Studio Code instead, I don't know what to say, not being installable through Unity Hub I think the support is less, you can still try to install the package (Visual Studio Code Editor) in the package manager and see if it solves the problem.

Francesco - FL
  • 603
  • 1
  • 4
  • 25
  • That's the thing that I did. I have installed vscode 2019 using the above method and it works. But my question is that why is it not working in vscode's new version? I am not comfortable with this old 2019 version. – Meet Shah Aug 03 '21 at 12:15
  • 1
    Warning, Visual Studio Code is not the same as Visual Studio Community, see here https://stackoverflow.com/questions/30527522/what-are-the-differences-between-visual-studio-code-and-visual-studio. Unity in the Unity Hub makes you install Visual Studio Community, not Visual Studio Code. If you install Visual Studio Code, Unity may not support it properly. The latest version of Visual Studio Community is the 2019 version, like the one that can be installed via Unity Hub. – Francesco - FL Aug 03 '21 at 12:22