Void error

I was working on my game when I got 2 errors:

  1. (7, 14): error CS1519: Unexpected symbol `void’ in class, struct, or interface member declaration.
  2. (10,12): error CS1519: Unexpected symbol `void’ in class, struct, or interface member declaration

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>();

ScriptReference GetComponent

Instead of uploading screenshots, you can paste the code and format it with the 101/010.