Search Issue Tracker
Duplicate
Votes
0
Found in
5.1.0b6
Issue ID
695569
Regression
No
[EditorScript] Wrong error message when trying to attach a script from Editor folder to a game object
Steps to reproduce:
1. Open the attached project
2. Click the menu button Test\AddScript
3. Notice it will create a game object and it will try to add a script from Editor folder to it
4. Notice the message in the console: "Can't add script behaviour . The script needs to derive from MonoBehaviour!"
5. But the script is actually derived from MonoBehaviour. Therefore the message should say that such a script can not be attached to a game object because it is an editor script, not because it has to derive from MonoBehaviour. (Something similar as when you try to manually attach editor script to a GO, you then get "Can't add script. The script is an editor script.")
Comments (2)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- The Up, Down and other Buttons in a Style Sheet's Inspector unselect items when they are clicked while they are disabled
- Virtual Player remains active and still launches when removed from Additional Editor Instances from a custom Play Mode Scenario
- UI Toolkit Editor Window Creator becomes not interactable and greyed out when a long name is entered
- [Web][iOS] Web Player keeps restarting on launch when Native C/C++ Multithreading is enabled
- "Add Scene to Scenes in Build" pop-up reappears after Scene has already been added and another Multiplayer Editor Instance is loaded
hwilliams
Jul 16, 2016 05:32
I'm not sure if this is the same issue, but I followed the "Unity - Building A Custom Inspector" tutorial here http://unity3d.com/learn/tutorials/topics/interface-essentials/building-custom-inspector?playlist=17117 and got the following error when trying to apply the script to an empty gameObject:
"Can't add script behaviour LevelScriptEditor. The script needs to derive from MonoBehaviour!"
doug__
Jan 23, 2016 07:02
Any chance we could get a link to the issue that this duplicates so I can vote on it?
I just wasted an hour writing unit tests with this bug.