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

Forum Archive when i drag the ball script to the inspector i get this, Can't add script component "ball" because the script class cannot… Reply To: when i drag the ball script to the inspector i get this, Can't add script component "ball" because the script class cannot…

#23004
Jonathan Gonzalez
Participant

    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.