- Home /
cant add script
just opened unity, normal day, and every script in unity has stoped working. idk why, but i tried creating new scripts, deleting libary folder, and reimporting all but still it does not work.
it says that class name does not match with name of file
please help
is the class name the same as the name of the script?
for instance the script in unity is called "Script_1" and in the code it is public class Script_1 : $$anonymous$$onoBehaviour
As this isn't reproducible, did you do anything the day before to your files? Did you maybe rename things in a weird order, and now Unity is confused about where to find things?
You can try removing the problematic scripts from your project, reloading Unity to let it catch its breath, then re-adding them. Can you post a copy of your log?
Failure generating network code. UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget)
Answer by teja6595 · Mar 11, 2020 at 09:05 AM
The class name and the that particular script name must be same otherwise this kind of error will come.
Check that all the scripts name you have in project window matches with its class name. Hope your problem will solve.
Over 2 years later one would hope they managed to add a script. Next time pay more attention to the age of the questions you answer.