Hi, this problem has been occuring since I installed and started using vs code for the RPG maker course.
Visual studio code doesn’t underline any syntax errors at all.
Also, I don’t get autocomplete options like ‘position’ when I’m typing e.g. target.position. However, I do get autocomplete options for OnCollisionEnter2D etc.
Here are the things I’ve tried so far to no avail:
installing .NET Core SDK onto my laptop. (is there something else I need to do with this for it to work in VS code?)
Uninstalling and reinstalling VS code.
right clicking and selecting ‘open C# project’ when opening my C# script from unity.
uninstalling and reinstalling unity snippets extension in VS code.
In case Michael’s solution did not work for you, please watch lecture “Fixing Visual Studio Problems” (currently #7). There are a few more things you could try.
I’m using unity version 2018.4.28 because that’s the closest version to 2018.3 that I could find. I’m using this version because that’s the one rick is using for the course and recommended that we use the same version.
Well in that case, you can try watching the lecture Nina suggested.
By the way, what is that “code.cmd” script editor you have selected? Is that how Unity recognizes VS Code in 2018 or have you selected the actual command prompt that comes with VS Code?
Michael I think you were right about the code.cmd that I had selected as the script editor for unity. I don’t know how I managed that before, but I changed it by clicking browse and finding visual studio code in my file explorer.
That didn’t actually fix it but it did cause an error message to appear in visual studio code:
So I think there was a problem with loading the project in VScode. So I tried opening the script from unity by right clicking and selecting ‘open C# project’, and low and behold, I started getting red squiggly lines underneath my syntax errors. It also solved my problem with the autocomplete suggestions.