Home > Net >  Setting Unity's External Script Editor to Visual Studio Causes Errors
Setting Unity's External Script Editor to Visual Studio Causes Errors

Time:08-01

Visual Studio was not giving autocomplete suggestions because in Unity, the external script editor (under Edit > Preferences > External Tools) was set to "open by file extension" and not "Visual Studio Community." But, switching to Visual Studio Community caused a whole host of seemingly random errors. In the bottom half one file, all references to variables declared in the class give "the name '[insert variable name]' does not exist in the current context," despite the fact that the same variables work perfectly fine in the upper half of the file. It gives a"} expected" error despite the fact that there are several closing brackets below. Plus, there are other errors which I don't understand: part of the error list. Switching back to "open by file extension" makes the errors go away, but then I can't use the autocomplete.

CodePudding user response:

Welcome to Stack overflow. That's interesting question. Have you checked This ??? Try steps that you might missed during installation. Also tick "embedded packages" checkbox

CodePudding user response:

It seems that retyping all the code got rid of the errors. Still no idea what caused it though.

  • Related