0

I recently installed unity ,but I didn't install visual studio with it because I already have installed. I simply opened unity and I goes to Edit > Preferences > External script editor and I selected Visual studio code . But when I opening my scripts, visual studio not giving hints for my c# code.

unity Externals tools Visual studio code

vikram
  • 84
  • 9
  • 1
    If you had searched SO you would see this comes up many times. Visual studio is not the same as visual studio code and the code editor does not seem to set up as easily as visual studio itself this has been answered many times – BugFinder Apr 28 '21 at 08:06
  • Does this answer your question? [VS Code IntelliSense not working for Unity3d](https://stackoverflow.com/questions/59823422/vs-code-intellisense-not-working-for-unity3d) – BugFinder Apr 28 '21 at 08:08
  • yes ..it worked .. – vikram Apr 29 '21 at 06:34
  • this vs code not worked, i downloaded the another one and everything working fine – vikram Apr 29 '21 at 06:35

3 Answers3

0

You probably need to install the appropriate targeting pack for Unity. That article also has some other helpful extensions to install when developing in Unity.

Wellerman
  • 846
  • 4
  • 14
0

What you could do is just open it and close it.

What i mean by that is go to Assets > Open C# Project

Once VSCode opened, wait for 1 min, try to write something like Rigidbody. If intellisense is working it will start giving you hints, if it's still not working

Do the process one more time,

You can refer to these pictures where how VSCode tells you whether Intellisense is working or not. https://i.stack.imgur.com/FJ6uL.jpg

0

You need to install snippets for Unity in VS code. Open VS code. Go to Extensions(ctrl+shift+X). In search field you need to write unity Then click to Unity Code Snippets and install it in window bellow. Then you will be able to see Intelesence !

  • maybe you will need to install C# ms-dotnettools.csharp tool too. – Roman Lemberg Apr 28 '21 at 07:49
  • this question is about VisualStudio not vs-code – Ali Besharati Apr 28 '21 at 08:19
  • 2
    But on Screenshot it`s VS code) If you need to Intelesense in VS, you need to go to Extensions > Manage Extensions > in Find field add 'Unity', then download Unity File Templates and Snippets. Then, in Unity, preferences>External tools> choice Visual Studio in External script editor. Then reopen VS, await few seconds, and you will see Intelesense ) – Roman Lemberg Apr 28 '21 at 08:29