I have some experience with visual studio and normally when i use it it tells me where i have made a mistake. I recently just got unity and was following a tutorial but visual studio seems to be ignoring any unity specific commands I use and therefore I do not know where i have made a mistake. Normally the once you write a word correctly like int or string it changes colour to blue but with any of the unity variables like GameObject they stay white which didn’t happen in the tutorial. Any ideas on how to fix this
It is most likely because you didn’t open the project from inside unity. (Visual studio does not know that it is a unity project)
Also, check that you have the unity tools installed from the visual studio installer and that unity is using visual studio as the editor:
In the Unity editor, go to Edit > Preferences.
In the Preferences window, go to the External Tools tab.
Under External Script Editor, select Visual Studio.
Try closing Visual Studio and opening in unity by double-clicking on a script
Or it can be that a unity namespace is missing or not found.
Ensure you have this:
using UnityEngine;
It can be that the visual studio IntelliSense is not working properly:
you can try restarting visual studio, updating unity and or visual studio and restarting your pc.
Also, check this:
And:
https://forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/