I am getting an error when attempting to add the script.

Forum Archive I am getting an error when attempting to add the script.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8688
    Deborah Douglas
    Participant

      “Can’t add script component ‘Rocketship’ because the script class cannot be found.  Make sure that there are no compile errors and that the file name and class name match.”  I have attached an image of my code.  

      
      
      #29168
      Deborah Douglas
      Participant

        I had a couple of typos in here and didn’t realize it. It is working now!

        #29169
        Jonathan Gonzalez
        Participant

          Great! Just to clarify what the error was for anyone else who runs into this. The reason you get that error is because the class name and the file name do not match. These are case sensitive. So if you created the script file and called it “rocketship” and the class name was Rocketship, they would be seen as two separate files and the class would basically not be referenced anywhere. Most of the time this happens initially when you accidentally hit enter before you change the name of the file upon creating it. 

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The topic ‘I am getting an error when attempting to add the script.’ is closed to new replies.