I was working on my game when I got 2 errors:
- (7, 14): error CS1519: Unexpected symbol `void’ in class, struct, or interface member declaration.
- (10,12): error CS1519: Unexpected symbol `void’ in class, struct, or interface member declaration
I was working on my game when I got 2 errors:
Missing semicolons and the “f” for the float values;
public float movementSpeed = 5.0
should be public float movementSpeed = 5.0f;
Note the f and semicolon at the end. f;
There’s also another error that you’ll discover after fixing the floats:
CharacterController cc = GetComponent(CharacterController);
This won’t work in c#. It should be either:
CharacterController cc = GetComponent(typeof(CharacterController)) as CharacterController;
CharacterController cc = GetComponent<CharacterController>();
Instead of uploading screenshots, you can paste the code and format it with the 101/010.