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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
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.