Search Issue Tracker
Won't Fix
Votes
0
Found in
2017.3.0a1
2018.3.0a1
2018.3.1f1
2019.1.0a1
2019.2.0a1
Issue ID
1119937
Regression
No
Obscure errors thrown when scene contains GameObject with non-MonoBehaviour script
How to reproduce:
1. Open the attached "Repro.zip" project
2. Open the Main scene
3. Enter Play mode
4. Observe the Console errors
5. In Hierarchy, select "GameObject" prefab and remove the reference to non-MonoBehaviourscript
6. Enter the Play mode again
7. Observe the same Console errors.
Expected behavior: Along with (or instead of) the below-mentioned errors, the user is informed about the class that is not derived from MonoBehaviour or ScriptableObject.
Actual behavior: The error message that informs about the class that is not derived from MonoBehaviour or ScriptableObject is shown only when entering Play mode in the scene that contains a GameObject with such non-MonoBehaviour component.
Reproducible with - 2017.3.0a1, 2017.4.19f1, 2018.3.3f1, 2019.1.0b1, 2019.2.0a3
Errors thrown:
- "'<...>' is missing the class attribute 'ExtensionOfNativeClass'!" (does not appear in 2017.4)
- "GameObject (named '<...>') references runtime script in scene file. Fixing!"
Workaround: Manually remove non-MonoBehavour script components from GameObjects and Prefabs.
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
- Foldout arrow indent is misaligned in the Inspector when used in Custom Type
- [Android] The Player screen turns black when playing a video under certain conditions
- Search window icons at the bottom are cut off when Search window is resized vertically
- "Try something else?" text label is cut off when searching for a long text in the Search window
- Rendering Debugger window sections do not have a minimum width set when resizing with the slider in the middle of the window
Resolution Note (2018.3.X):
Until the reference to the script is removed from the prefab this error will continue to pop up. This is because entering play mode works by loading the scene and the prefab (which causes the error), then merge the prefab into scene during which the component is removed. So removing it in the scene is not enough the reference also needs to be removed from the prefab.