top of page

Can't Add A Script On A Unity Project Fix Solution


Have you encountered a problem while wprking on your unity project that looks like the above? "Can't add script component 'newScript' because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match."

It was a easy problem to fix. This problem could have occurred due to you creating a new script and opening it in visual studio, and than manually changing the name through the unity engine. Simply follow the directions below and you should have no problem adding a script to your game objects.

Open up visual studio with the script you are trying to use. Look at the name of the namespace and see if it matches the name of your unity script inside your folder, if it does not change the name to match the unity folders scripts name and voila. Image below shows what name to change in the script. Once you change the name of the script in visual studio to correspond to your scripts name inside of the unity project folder, you should be able to add your scripts like normal =).

Looking for a Zero Commission Trading Brokerage? click to learn more Get a free stock when you sign up with my Robinhood Link, it helps me and you and you don't even need to purchase anything.

Featured Posts
Recent Posts
Archive
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Instagram Social Icon
  • Google+ Basic Square
bottom of page