Hi I've attempted to add an empty c# script to my player and I keep getting this error I'm on version 2020.3.25f1 of unity any help would be appreciated. The error I get
Asked
Active
Viewed 145 times
-1
-
3Does this answer your question? [Can't add script component because the script class cannot be found?](https://stackoverflow.com/questions/51713497/cant-add-script-component-because-the-script-class-cannot-be-found) – joll05 Jan 29 '22 at 16:54
-
You cant have an _empty_ c# script, it must have a script class definition in it. – Chris Schaller Jan 29 '22 at 17:25
1 Answers
0
First of all, if you script is entirly empty with no class or anything. Unity will spout that error. In that case you will need to recreate a script that has all the public class stuff. The most likely case is that if you go into your script and onto this line public class [ScriptName] : MonoBehaviour
your script name does not match the one shown in unity, there might be a upper or lower case difference. Lastly, you script could be inheriting from something thats not MonoBehaviour (Like another script) and that script may be needed on the player object to apply this one.

Enoch
- 11
- 2