Hello there…
I have, yet again, a huge problem. I had some troubles with the Gravestone script.
It all started with an Error:
You are trying to replace or create a prefab from the instance ‘Gravestone’ that contains the script ‘Health’, which is does not derive from MonoBehavior. This is not allowed.
Please change the script to derive from MonoBehavior or remove it from the game object.
UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
So I deleted the script, created a new one, but still the same, i restarted Unity and then the troubles began!
So my Problem is, every script in my Project has now this Error of MonoBehavior.
-What caused this?
-How can I prevent this?
-And how can i reset my Project? (I tried to make a hard reset with sourcetree, but that didn’t work either…)
If somebody had the same Probelm and a Solution for it, I would appreciate help.
I could fix it in the meantime, but still do not know why…
I didn’t change anything in the Health.cs, but deleted the Fox.cs and wrote it from scratch (I did not copy it from the Lizard, like in the course)
Sooo… it works now… and because there is no real solution, I think you can delete the post if you want
Errors can often cascade, one thing causes another and so on.
The specific error message can often be attributed to the class name and the script name not being the same. Obviously without being able to see the issue it’s hard to say now.
Again, glad you’ve resolved the problem and can move on