- Home /
What's this error?
Hi guys,
I'm using JavaScript and I keep coming across this error:
the class defined in script [myScriptNameHere] file name does not match the file name
this only happens when i copy the project folder over to my external hard drive and try and open it from there, the original has no problems.
what am i doing wrong?
cheers
That's funny, I didn't think that happened in javascript... are you sure there aren't any bits in C#?
Only happens to me if I use a C# script. $$anonymous$$aybe a script got pushed into the wrong place?
Answer by Graham-Dunnett · Oct 24, 2011 at 01:40 PM
When you write Javascript files in Unity the editor does some things behind the scenes to make the filename and the class that is defined to be the same. I fully expect that when you move the project over to an external hard drive somehow the names of the files are being changed, well, their casing, specifically. This can mess things up. Perhaps zip the project up and move it, then unzip on the new machine.
Your answer
![](https://koobas.hobune.stream/wayback/20220613021108im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
BCE0005: Unknown identifier: 'spriteRenderer'. 2 Answers
Help with the code 1 Answer
Boolean Errors 2 Answers
Fix this error on line 28: expecting EOF 0 Answers
Enemy AI Error 1 Answer