1

I'm trying to set up my VS Code in order to properly work with a Unity project using Windows 10 as OS. This is what I've done:

  • Installation of Unity v.2019.3.0a2;
  • Installation of Visual Studio Code v.1.40.2;
  • Installation of C# (the Visual Studio Code extension);
  • Installation of .Net;
  • Setting up VS Code as Unity Script Editor (as described here);

At this point I imported my project root folder in the VS Code workspace but the IntelliSense function doesn't work. So I read this guide and then I ran:

dotnet new console
dotnet run

Now it seems that the IntelliSense works but VS Code doesn't recognize the Unity classes and, for this reason, my project is full of errors. Is there a way to fix it or to import the UnityEngine package?

0

1 Answer 1

1

You don't need .Net for working with Unity projects. Just install Microsoft .Net Framework 4.7.1 SDK to make your C# Omnisharp VS Code extension work properly. Nothing else should be done, just open your project and everything should be OK.

See your VS Code OUTPUT->Omnisharp Log, it'll ask you to install .Net Framework SDK

Also, you need to open your project with Unity Editor at least once, otherwise you'll get a lot of The name 'gameObject' does not exist in the current context [Assembly-CSharp]csharp(CS0103), The type or namespace name 'GameObject' could not be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp]csharp(CS0246) and so on erros in your VS Code even for a workable project.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.