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…

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4750
    al201273
    Participant

      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.

      #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.

        #23005
        al201273
        Participant

          Thank you

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The topic ‘when i drag the ball script to the inspector i get this, Can't add script component "ball" because the script class cannot…’ is closed to new replies.