Error Code: Assets\Code\PlayerLocomotion.cs(46,35): error CS1002: ; expected

Never post code (especially so much of it) as plain text. Please edit your post to use code-tags . As you did in your subsequent post here .

So this has nothing whatsoever to do with Unity specifically. It’s the C# language and like any language it has rules such as using semi-colons to indicate end of lines. You must know this already because your code already does it so being new has nothing to do with this. It looks like you simply need to read the compiler error message.

Error Code: Assets\Code\PlayerLocomotion.cs(46,35): error CS1002: ; expected

So an error code, in the file “Assets\Code\PlayerLocomotion.cs” at line 46, column 35 with an error code of “CS1002” with error description “; expected”. Seems pretty clear!

The compiler is telling you that you made a typo, in this case, it’s expecting a semi-colon but encountered something else, because of your typo. It even tells you the exact line/column number (46/35) to look! Did you look there?

Note that because it’s plain text, it doesn’t include line numbers but a super quick scan shows the missing ; so even without knowing the line you should be able to see it quickly.

2 Likes