Could you please share a screenshot of the entire console window? And which version of Unity do you use?
So does this sound like something is up with the script? Should I try creating a new C# script and do it again from scratch to see if there’s just something going wonky with VS Code for this particular script for some reason?
Creating a new script might be a good idea. At least, that’s something you should try. Don’t waste too much time on it. Just copy the OnCollisionEnter method from the API into your script and replace the code block with a simple Debug.Log.
That might well be the case. Some students experience “interesting” side effects with VS Code for no apparent reason. Go to Edit > Preferences > External Tools and try to click on “Regenerate project files” if that option is available.
Here are more suggestions:
Please follow the instruction on this website and make sure all required extensions are installed: https://code.visualstudio.com/docs/other/unity
If the issue persists, please check the console of VS Code (not Unity!). If the .NET Framework 4.7.1 (Developer Pack) is mentioned there, download and install it from the official Microsoft. Here is the link: https://dotnet.microsoft.com/download/dotnet-framework/net471
Depending on your version of Unity, it might be that you will have to install the “Visual Studio Code Editor” package in Window > Package Manager in Unity.
Maybe you’ll have to reboot your computer. Then launch Unity again and open one of your scripts.
If nothing helps, I would suggest to install Visual Studio (not Visual Studio Code). Select it as your External Script Editor in Unity (Edit > Preferences > External Tools). In the Package Manager, install the “Visual Studio Editor” if it’s not installed yet.