why do I keep getting errors?

Started by
11 comments, last by Alberth 2 years, 9 months ago
Advertisement

In the future, please just copy the text and paste it here in a code block. A screen shot image pasted into a google drive document then shared, then pasted that link is a long way around.

I'll transcribe three of the errors from that screen shot.

MainMenu.cs(10,59): error CS1001: Identifier expected
MainMenu.cs(10,59): error CS1003: Syntax error, “,” expected

Check line 59. There is probably a parameter missing. There might also be a semicolon missing at the end, or the compiler just got confused with the missing identifier.

LoadScene() has a mandatory parameter of the scene name, and an optional parameter of the mode. Check the spellings of everything.

MainMenu.cs(10,60): Error CS8124: Tuple must contain at least two elements.

Check line 60. This might be a carry-over from earlier errors, or from bigger structural errors. Possibly you have code that is outside of a function body, either because the compiler is struggling to recover from earlier errors, or because you misplaced some semicolons.

Repeat for the other errors. Line 61 and 62 are missing semicolons at the end, again either because they are actually missing or because of errors on earlier lines.

Lines 73 and 77 are missing other punctuation, but have similar issues.

ok sorry to sound dumb but i dont know what you mean on line 55 because there are not that many lines. ive only recently been taking a class on this and dont understand what that would mean.

so how do I implement your solution?

thecapl said:
so how do I implement your solution?

The instructions above are really pretty much literally what you have to do, but without you understanding them, there is no way for us to explain it to you.

What you need is more knowledge in the mechanics of writing code, understanding compiler output, and knowing how to fix those things in seconds to minutes(!). You can learn this by doing a few C# tutorials first before you try writing a game. Find a few C# tutorials, and write and debug small exercise programs, get some experience in writing code.

It may take a few weeks, but for making games it hardly makes a difference (it takes a lifetime anyway). It will make problems like the above trivial to fix, and you will understand much better what Unity code and its documentation is saying, it will make much more sense to you. That will speed up learning to make games a lot. As such, doing a few C# tutorials is a very good investment here.

This topic is closed to new replies.

Advertisement