Error code cs0106

i was watching a tutorial and and it was s
showing error code cs0106 what should i do

also my version may not be correct so idk

PLEASE HELP! I REALLY NEED ALL THE HELP I CAN GET. :grinning:

You should really start this tutorial again. You’re missing the open and closing curly braces for the entire class.

2 Likes

I really think people should learn the basics of C# befor even touching unity. Create a small console app or something. Just to get the hang of the environment, syntax etc

That is certainly part of the problem. I believe it is fair to say that people often don’t question “why” things are done. So braces, parentheses, semicolons, keywords, etc. are essentially invisible. It doesn’t feel wrong when something is missing if there is no understanding about why they are present.

Yeah, truth is that most tutorial makers know people don’t really have patience to learn, so the whole methodology of “You won’t understand anything I’m doing, just follow along and it will make sense when we’re done” leave these huge gaps in real understanding of how code works.

2 Likes

as others said theres missing braces round your class as a whole, each method has a ; after the declaration leaving all the code which is in the braces confused…

Note, your error will have text, and a line number and a position on the line. It is generally pretty accurate…

Programming is about attention to detail, remember, you think as a human, the computer only 0 or 1, the programming language does its best to give you an interface which you can explain in words more human like, but its still down to you to write in a way that lanugage works, it has different syntax etc

after all in english “rubber duck” in french its duck of plastic or duck of eraser (as in we in britain call erasers rubbers, so, i guess that where that comes from)

Thanks For All The Help!