Typically that error appears when your class name and your file name don’t match. So your script and class name should both be “ball”. If your change the name of your file in the project panel but don’t change the class name within the script Unity will give that error.