Error: No MonoBehaviour Scripts in the file

I’m following the 2D Roguelike tutorial, but I can’t add the scripts to the GameObject. I see the following error in the scripts: “No MonoBehaviour scripts in the file, or their names do not match the file name”.

The public class has the same name as the file, it as MonoBehaviour, everything looks ok:
Imgur
Imgur

Thoughts?

I see some red in the visual studio, do you have compile errors?

2 Likes

I think you need to scroll down and fix those script errors that VS is complaining about first.

That’s it! I had some errors. Thanks!

1 Like