The script don't inherit a native class that can manage a script.
Hi, I am using the latest Unity 2020 (2020.2.0.a13) and every time I try to attach a script it won't let me, complaining that "The script don't inherit a native class that can manage a script."
I encountered this problem first time couple days ago, I don't remember if turning my pc on/off or closing Unity solved it.
Now I am stuck with this issue, I tried what I mentioned above without success. Any suggestion?g)
(I have created an empty script that basically just inherits from MonoBehaviour and tried to attach it to an empty gameObject, won't let me so frustrating)
Answer by graigjin · Jun 17, 2020 at 09:47 AM
For me this occured when my script did not contain a class with the same name as the script. E.g. script name is "MyScript.cs" you need a class named "MyScript" inside, otherwise you will get this error.
Still, I have the same problem...
Name of the script: Noise
public static class Noise {
}
Answer by zoeyducoeur · Jan 04, 2021 at 10:19 PM
I went back into my ctrl+z and found I accidentally moved the MonoBehaviour script from it's home. Not saying that'll work for you but it fixed my "The script don't inherit a native class that can manage a script" problem
Answer by hern-04 · May 22, 2021 at 09:35 PM
What I think makes this problem is that you give your Script a name that has a space in it. Unity Automatically makes your class have this name with a space included as well and a Class name can't have spaces in it. This is what causes the problem. Make another script that doesn't include a space and see if this works.,This
Answer by olivait · Mar 31, 2021 at 06:26 PM
Delete the script, Click on the game object in the Hiearchy, you need to attach the script to. In the Inspector, go to Add Component/New Script. Name it what you want hit Create and Add
Answer by diegoadum · Jun 01, 2021 at 06:28 PM
Hi, in my case I have a Generics Class named Grid, which is defined as public class Grid<TGridObject>
which file name is Grid.cs but I'm still having the same error. Any additional idea to fix this?
Your answer
Follow this Question
Related Questions
UnityEditor unusable ? :: error CS0016 1 Answer
NullReferenceException: Object reference not set to an instance of an object (int[,]) 1 Answer
Applying Scripts held in a list to a game object 1 Answer
IOException: Sharing violation on path... 0 Answers
"In the editor isDebugBuild always returns true." is false? 0 Answers