- Home /
Question by
FlammingFart · Dec 29, 2012 at 12:17 PM ·
error message
i cant add my scripts
"can't add behaviour health. the scripts file name does not match the file name of the class defined in the script!"
:( please help.. im using .js and c#
this is for educational purpose only
Comment
Best Answer
Answer by FlammingFart · Dec 29, 2012 at 12:46 PM
ohhh okay i think i get it :) thanks for the help :D
Answer by Piflik · Dec 29, 2012 at 12:21 PM
You class name has to be the same as the file name, just like the error message tells you... (where ignoring abstract classes and interfaces here...)
Example: if you have a TestScript.cs, then the first line after the imports has to be 'public class Pickup : Monobehaviour {}'
Your answer
![](https://koobas.hobune.stream/wayback/20220613090100im_/https://answers.unity.com/themes/thub/images/avi.jpg)