Hello,
im trying to add a script to my player but i always get this error: “cant add script component because the script class cannot be found. Make sure that there are no compile errors and the class name and file name match”
How do i fix this?
Hello,
im trying to add a script to my player but i always get this error: “cant add script component because the script class cannot be found. Make sure that there are no compile errors and the class name and file name match”
How do i fix this?
The name of your script file needs to match the name of the class defined in that file. Also, the class needs to inherit from MonoBehaviour if you want to attach it to a game object.
Edit: Also, posts about script errors should go in the scripting forumL Unity Engine - Unity Discussions