Home > Blockchain >  Visual studio code Intellisense not working with Unity Engine?
Visual studio code Intellisense not working with Unity Engine?

Time:12-23

I am currently working on a C# file and my Intellisense doesn't seem to be working on Visual Studio Code. I have tried generating all .csproj files as well as downloading the .Net framework dev pack 4.2 and changed the Api Compatibility Level to .NET 4.x accordingly. An example of intellisense that would be helpful is something simple like

Vector2 touchPosition = Camera.main.ScreenTowWorldPoint(touch.position);

when I type Camera.main. and attempt to use the intellisense I would expect to see the function ScreenToWorldPoint(Vector2) as a possible function I could use but nothing shows.

CodePudding user response:

Preferences > External Tools > External Script Editor

Set this to VSCode, or whichever editor you want. Make sure you have the VSCode editor package installed, found here.

CodePudding user response:

Finally solved the issue.

First had to make sure that it wasn't a duel drive problem with Unity on D: drive and VS Code on C:

and then after reinstalling that when you open a C# file the IntelliSense may still not work.

To fix that I had to select Assets > Open C# Project After you do that if you open a C# script even just by double clicking the IntelliSense works fine.

  • Related