Home>

I created a C # script in Unity, but "No MonoBehaviour scripts in the file, or their names do not match the file name" is displayed, and the script cannot be attached to the component.
When I looked into it, it seems that the cause is often a mismatch between the file name and class name. When I checked it in the console, the error itself was displayed, but the log was not displayed.
Screenshot of problem area


Problem area