when i drag the ball script to the inspector i get this, Can't add script component "ball" because the script class cannot...

when i drag the ball script to the inspector i get this, Can't add script component "ball" because the script class cannot be found. Make sure there are no compile errors and that the file name and cass name match. i checked everything and my script looks like yours.
  • Jonathan Gonzalez(jgonzalez) replied
    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.
  • al201273 replied
    Thank you