Visual Studio Code does not suggest Unity methods and classes

Asked

Viewed 556 times

0

If I type the code and pass it to Unity, Unity runs the code normally, but Visual Studio is not recognizing Unity (as you can see in the colors of the photo below), which makes it very difficult to program. At the installation, I left the "Game Development with Unity" box marked, along with "Development for Descktop with . NET". I already gave up this version and installed it again. The problem continues.

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

1 answer

2


The image is about VS Enterprise, not about Vscode, but anyway to use Unity in Vscode install the extensions:

Press Vscode Ctrl+Shift+X or go to the side menu:

extensões unity para VSCode

Remember that if the default editor that opens is another to swap you should go to Edit > Preferences > External tools

Trocar o editor padrão no unity

Then go on Window > Package Manager and type in the Vscode field and update or install the vscode package:

pacote do vscode

By now everything should be ok and working on Vscode (you may have to close Vscode once), result:

autocomplete classes unity no vscode


Installing snippets for Unity in Vscode

It may be that maybe you weren’t talking about it, but rather semi-ready structures/suggestions that the editor can provide, if that’s the case you have to install the extension:

Same process, Ctrl+Shift+X or go to the side menu:

snippets para unity no vscode

  • It worked! More specifically when I went to on Package Manager and clicked to update VS Code. That was the problem. Thank you

  • @Gustavogld blz. Then mark the correct answer: https://pt.meta.stackoverflow.com/a/1079/3635

Browser other questions tagged

You are not signed in. Login or sign up in order to post.