1

I've downloaded VSCode as an IDE for Unity including the extensions unity Debugger and Unity code snippets. The editor shows me suggentions like awake() or start() methods but no variables like Rigidbody, transform or input. How can i solve this problem?

David Buck
  • 3,752
  • 35
  • 31
  • 35
  • 1
    Does this answer your question? [Visual Studio Code error when using Unity](https://stackoverflow.com/questions/61924474/visual-studio-code-error-when-using-unity) –  Jun 04 '20 at 06:23

4 Answers4

1

I´ve had the same problem. Only switching to Visual Studio (and downloading the Unity extension) solved it for me.

My Colleagues first recommended Code to me too, but in the end I didn´t see the benefit in it.

MrScreeps
  • 21
  • 5
1

In Unity Edit -> Preferences -> External Tools -> Select your external script editor

Still having troubles?

I answered a similar question here:

Visual Studio Code error when using unity

Also here:

How to get Visual Studio to recommend unity codes

vasmos
  • 2,472
  • 1
  • 10
  • 21
1

You can install only one extension for Unity in VSCode. unity3d-pack (1.0.0)

This package contains 10 packages in it and all sub-packages are useful for Unity programming.

C#
C# FixFormat
C# Snippets
C# XML Documentation Comments
Debugger for Unity
Shader languages support
Unity Code Snippets
Unity Tools
ShaderlabVSCode(Free)
Code Outline
gmspacex
  • 642
  • 5
  • 12
0

I tried a few different quick-fix solutions, and none of them worked for me. I finally realized that there was a better way to debug this myself:

  1. Open the Output panel in VSCode ("View -> Output" from the top menu)
  2. Select "OmniSharp Log" from the drop-down in the top right of the Output panel

The problems were MUCH easier to debug once I could see the problems OmniSharp was having just trying to start up. Here were the problems on my Mac:

  • Somehow, the option "Omnisharp: Use Modern Net" was set to true. This is not supported by the Unity integration, so I had to unset it.
  • Even though dotnet was on my path, VSCode couldn't find it. I ran which dotnet in a terminal to find the path to the dotnet executable, and set the "Omnisharp: Dotnet Path" setting to that path.
  • Even though mono was on my path, VSCode couldn't find it. I ran which mono in a terminal to find the path to the mono executable, and set the "Omnisharp: Mono Path" setting to that path.
Chris Jaynes
  • 2,868
  • 30
  • 29