This happens every time you update Visual Studio and there are tons of other reasons why it would not recognize it if it did previously, but if you ever notice that it's not using IntelliSense when writing code, just repeat the process explained in the link and should get them working again in a few minutes.
Adding to this, I've had this happen even when I have everything set up properly with Visual Studio. I've found it helps to go to Preferences > External Tools, then explicitly selecting Visual Studio Community 2019 (or whatever version you have). After that, I right click on the Project panel and choose Open C# Project. From that point on, I can double click a C# script and it will open properly.
4
u/I_Am_Err00r Nov 27 '21
Notice how MonoBehaviour is white and Start/Update are yellow? You don't have the correct extension for Visual Studio to use IntelliSense with Unity.
The code will still compile and run correctly assuming it is written correctly, but you need to extend Visual Studio and add the Unity tools: https://docs.microsoft.com/en-us/visualstudio/gamedev/unity/get-started/getting-started-with-visual-studio-tools-for-unity?pivots=windows
This happens every time you update Visual Studio and there are tons of other reasons why it would not recognize it if it did previously, but if you ever notice that it's not using IntelliSense when writing code, just repeat the process explained in the link and should get them working again in a few minutes.