Help T___T My project is falling apart

Hi, I have a really strange and allarming issue here:
I closed my project (project boost from Unity 3D course) a couple of hours ago, it worked fine… Now I reopened it, and suddenly all the scripts are broken. On the inspector it says this:

error1

And the console report this message:

Assets\scripts\interazioneOstacoli.cs(37,17): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement

I tried to make an empty new script for test, but when I try to place in a GameObject this popup appers:

I noticed that, inside Visual Studio Code, there is this message:

This is there since the beginning (I was unable to use a couple of functions, I planned to find a solution in the future), I have no idea if this could be the cause…

I’m a little affraid now, because I can easily restart this project (it’s part of a lesson, I don’t have a backup) but what if this kind of issue will show during a bigger project!?

Anybody has an idea of this issue, and hopefully a solution!?
Thanks in advance!

Hi YRO,

I doubt that you’ll have to restart the project. The error message says that there is a compiler error in your test.cs. That’s probably just a typo somewhere or a misplaced curly bracket. Have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture?

Hi Nina,
I checked the code, no errors T___T also, I copy/pasted it on a new script in a new project, and it works fine without errors.

In the incrimined project, still, if I create a new empty script the SW says that it too has errors… Every single script in that project, old or new, does not work at all. In the inspector they appear without name…

Is Visual Studio Code selected as your External Script Editor in Unity (Edit > Preferences > External Tools)? Are all the required extensions installed?

1 Like

Hi
again!
Yup, it was selected as my editor… I solved this by partially reconstructing the project (Luckily if I copy/pasted the scripts in new ones in a new project, they worked).

About the error on VSCode, i solved it following this:

Hopefulyl all will work fine now XD

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

Privacy & Terms