no monobehaviour scripts in the file or their names do not match the file name

Hello everyone,

I come here with despair. For some days I have this error on all my scripts:

“no monobehaviour scripts in the file or their names do not match the file name”

While everything was working fine. Now no script works anymore. I made “reimport all” change the 2018-> 2019 version. In short, I am desperate. I know this error has happened before. But I can’t find any solution. Please help me. Thanks everyone.

:(:(:frowning:

So? What’s the filename and what is the name of the class you’re talking about?

the file name is exactly the same all my script but i have the error for every script : i have 4 errors in my compil but they are old and i don’t change nothing in this script… bouhhhhh

Okay, I can’t read your mind (I tried, I promise…). If you want help, copy the entire error message(s) here, write down the file names and at least partial code inside of them, but prefer the whole. And use code tags.

you can see on the top the error for the script. all the script are the same… thanks for you reply

i have the four error but i change nothing in. It was old scripts…

Two of the errors say it couldn’t find the namespace “Die”. Where is that defined? The other two errors may be downstream from the missing “Die” namespace problem.

You can see that the namespace is ok

I would start with removing all non-english characters from filenames and class names.
RotationdéRotationde

Second: hit the clear button in the console, so you get a clean slate and then check the errors. If the errors stay, then you have those files and the error is in there. If the “no monobehaviour scripts in the file or their names do not match the file name” message stays, it probably product of these errors, there are situations when the compiler can’t compile files because of errors.

Nope. Where is your Die.cs file and Die class? It says it cannot find it.

1 Like

7611817--945718--upload_2021-10-28_22-59-50.png
here is the Die_d10.cs

and the class
7611817--945724--upload_2021-10-28_23-1-39.png

txs for all

Your Die_d10 class is inheriting from a Die class which you don’t have in this file list.

Just look at your class definition in your Die_d10.cs.

Sorry i dont understand that i must change in the script?

I don’t know. :slight_smile: Do you have Die class somewhere?

ok i understand what do you mean. I looking for that and i come to you tXS

You can edit your posts here, just click on the “Edit” link.

YESSSSSSSSSSSSSS. Thanxs. I think i am stupid. But now i know that if there is a problem for all scrpit it is not the real problem. the problem wa under my eyes. So if someone as the same probleme look at your error juste your error. You resolve it and after all your script are available.

Txs. Now i have an other probleme but i try to solve it. probleme about
“com.unity.2d.sprite”: “1.0.0”,
“com.unity.2d.tilemap”: “1.0.0”,

not found.

I must look in package manager. But in unity 2018 not found form the moment.

Txs or all

YOUPIIIIIIIIIIIIIIIII