1

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.

zCUa
  • 21
  • 4
  • 1
    Does this answer your question? [How to get intellisense in Visual Studio Code for Unity functions names?](https://stackoverflow.com/questions/52189426/how-to-get-intellisense-in-visual-studio-code-for-unity-functions-names) – Ruzihm Dec 20 '21 at 19:49
  • No, I saw this post but I used each of the suggested solutions and none seem to be working. As I mentioned in the question I tried some of the top voted solutions and still not working for me. The question is the same though so I suppose I could post on there but I am unable to due to having a new account. – zCUa Dec 20 '21 at 21:44
  • I notice this one isn't there "VS Code > C# Extension (installed) > Extension setting > search for : mono > set the option to Always". There's something there for "if you're on mac" but this helps some on windows too – Ruzihm Dec 20 '21 at 22:34
  • I changed the setting in the Settings.json ```omnisharp.useGlobalMono": "always"```. After doing that I restarted Omnisharp and VSCode, but same issues persists. I also tried adding the following extensions: ```Debugger for Unity, Unity Snippets, Unity Tools``` – zCUa Dec 20 '21 at 23:50

3 Answers3

1

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.

Peter Csala
  • 10,331
  • 15
  • 20
  • 47
zCUa
  • 21
  • 4
0
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.

bnzzy
  • 1
  • 3
  • I tried the following but still doesn't seem to be working. I have tried multiple other solutions but it seems nothing is working. My intellisense works perfectly fine when using JS or other languages but it seems C# in general doesn't appear to be working. – zCUa Dec 22 '21 at 10:14
0

None of the solutions worked for me so what I did is Uninstalled all the .NET Softwares that were installed on my Machine. ---> I uninstalled these

Then I reinstalled the software from here
----> Install this version of .Net from here ⬇

https://dotnet.microsoft.com/en-us/download

Install this version of targeting pack from here ⬇

https://dotnet.microsoft.com/en-us/download/dotnet-framework/net471

After all this, I just reloaded the Vs code Window and it worked for me.

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/31905132) – MD. RAKIB HASAN Jun 03 '22 at 05:31