Why does Visual Studio Code not have intellisense for Unity keywords such as transform, or Vector3?

Viewed 3634

I am trying to learn Unity3d game development and would really appreciate some help here...

My issue is that upon typing a word such as transform (e.g transform.Rotate), instead of Intellisense lighting it up as a keyword, it highlights other suggestions such as OnTransformChildrenChanged() or OnTransformParentChanged().

Any possible way of fixing this?

I just downloaded Visual Studio Code and the extensions needed to work with Unity3d.

I also have Unity3d's code editor set to Visual Studio Code via Preferences -> External Tools -> External Tool Editor.

I have watched multiple tutorials and downloaded multiple extensions for unity tools in VSCode, but still no fix to the Intellisense.

2 Answers

first download and install this runtime app Windows: .NET Framework 4.6 Targeting Pack macOS: Download .NET SDK. download link all package for unity (package).

Open up Unity Preferences>-> External Tools>-> as External Script Editor.

after this choice the browse for the Visual Studio Cod executable .

The Visual Studio Code executable can be found at mac (osx) /Applications/Visual Studio Code.app. or at windows
C:\users{username}\AppData\Local\Programs\Microsoft VS Code\Code.exe by default. after restart both application double click on c# file and choice VS code for ide.

I realize what my problem was, it had to do with HOW I was opening my C# scripts.

In Unity, instead of double clicking the C# script to open it up in VSCode, Right click the Assets Folder and then choose Open C# Script.

This solved the problem I was having completely.

Related