Coding Difficulties

I am part of the way completed with the Obstacle Course project in the Complete C# Unity Game Developer 3D coding course and I’m having a few issues with the coding. Would someone mind telling me where I went wrong and what the proper syntax is?

I opened Unity today and opened my C# scripts to start coding but I found a few compiler errors. The previous day, I didn’t see any errors before closing Visual Studio Code and the code seemed to work fine. I worked for a while to try and troubleshoot the issue and find what went wrong (I didn’t alter the code so I was a bit confused) and, after a while, decided to close and re-open Unity after resetting all my code to its original state. I thought this might help/resolve the issue but when I opened the script again, less compiler errors showed up, but they were different ones. The prior errors were with the code inside the variables, (such as Debug.Log(Time.time); ), but now it shows up as the variables themselves. It would be greatly appreciated if anyone could shed some light on this and show me how to fix what I did wrong.

If it helps, I’ve only gotten to the ‘If Statements’ lesson.

Hi Blynd,

Please hover your mouse over line 16. What does the compiler say? Your code looks fine to me, so maybe there is an internal problem in VS Code or Unity. At least, that would explain why restarting makes errors (dis)appear.

Please follow the instruction on this website and make sure all required extensions are installed.

And download the .NET Framework 4.7.1 (Developer Pack) from the official Microsoft website and install it. Here is the link:

Maybe you’ll have to reboot your computer. Then launch Unity again and open one of your scripts.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms