Losing My Mind: Invalid Token (;)

FYI: Using code tags would keep the formatting for your text and make it much easier for us to read.

What IDE (text editor) are you using to write your code? I copied your code into Visual Studio Code and the error was immediately evident:
7604185--944167--upload_2021-10-26_11-57-58.png

See how the text highlighting broke on line 7, and for that big block after it? That’s usually a good indicator that you have something wrong. In this case, you’re declaring a class inside another class… which isn’t necessarily wrong as a rule, but probably not what you’re intending here.

The issue is you’re telling the compiler that you’re going to be defining a new class, and then you… don’t. You just drop a semicolon and walk away. The compiler expects you to follow class declarations with curly braces to define the contents of that class. What you probably meant to do here was to create a class member that was the instance of your PlayerController class… so just delete the word “class” on line 7.

2 Likes