That could be very confusing to some beginners. Specifically because of the error: No Monobehavior scripts in file, or their names do not match the file name
Scripts are just text assets (specifically, MonoScript assets), and technically speaking they can be named whatever. It’s only in the case of scriptable objects and monobehaviours that there’s a special requirement that the script’s asset name and the actual C# class name need to match exactly.
In other cases the script’s asset name can be whatever it wants, just that 99% of the time folks ensure the script and class name match out of good practice.
And by the way, class names can’t have spaces. So putting a space in when making a new script would just cause a compiler error, unless Unity omits the spaces from the class name.
2 Likes
ah, I see. Thanks for correcting me!
1 Like