DEV Community

Ryo Kuroyanagi
Ryo Kuroyanagi

Posted on

1

How to use VSCode for coding on Unity

TL;DR

  • Install C# Plugin for VS Code
  • Install .NET Core and .NET Framework
  • Generate project files (.csproj) by Unity preference menu

Background & Overview

Always I start using new PC, I get stuck with setting up VSCode for Unity programming. This is a quick note for people who are willing to set up VS Code for Unity. In the following sections, I explain how to enable intellisense on VSCode. Please note that I do not explain how to set up debugging (inserting breakpoint etc.).

Prerequisite

I assume that you have Unity and VSCode on your PC. I'm using Unity 2021 now but the steps may not change event for different Unity versions.

Step 1: Install C# VS Code plugin.

In your extensions search on VS Code or you can find the plugin on this page.

Step 2: Install .NET Core / .NET Framework

At this moment, we can download the SDK from on this page. The URL may change in the future.
I installed .NET Core 7. We need .NET Framework 4.7.1 for that core. I installed .NET Framework 4.8.1 first but it did not work and error messages told me I need ver 4.7.1. You may use another version of .NET Core,

Step 3: Generate C# project files.

On Unity editor, go to preference of editor [Edit] --> [Preferences] --> [External Tools]. Set External Script Editor as Visual Studio Code, check all checkboxes in Generate .csproj files for: section and then click Regenerate project files button.

Wrap-up

That's it! Hope this make your life easier.

Image of Quadratic

AI, code, and data connections in a familiar spreadsheet UI

Simplify data analysis by connecting directly to your database or API, writing code, and using the latest LLMs.

Try Quadratic free

Top comments (0)

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay