Search Issue Tracker
Fixed in 2018.3
Newly created script is not attached to a prefab if the script was created in the prefab edit mode
How to reproduce:
1. Open the attached Unity project
2. Open "SampleScene"
3. Select Sphere's prefab in the scene and go to its edit mode
4. Press "Add Component"
5. Create and add a new script
Expected result: a newly created script is added to the prefab
Actual result: an error message appears; the script is not added to the prefab (can be seen only after closing the prefab edit mode)
Reproducible with - 2018.3.0a6, 2018.3.0a9
Could not test with - 2017.1.5f1, 2017.2.3p3, 2017.4.9f1, 2018.1.9f1, 2018.2.5f1, 2018.3.0a5 (does not have a prefab edit mode)
"You are trying to replace or create a Prefab from the instance 'Sphere' that contains the script 'test', which does not derive from MonoBehaviour. This is not allowed.
Please change the script to derive from MonoBehaviour or remove it from the GameObject.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [XR] Vulkan graphics device lacks support for additional graphics queue when using Oculus XR provider
- [TransformTool] Shift rotate always reset the rotation value when used
- Crash in wrapper managed-to-native) System.Diagnostics.StackFrame:get_frame_info (int,bo when importing an mp4 5760 x 2880 video
- Bug reporter on MacOS doesn't correctly support dark mode
- [Vulkan][Android] Video Player in 2018.4 using Vulkan does not play Videos