Search Issue Tracker
Fixed in 2018.3.X
Votes
0
Found in
2018.3.0a9
Issue ID
1072552
Regression
No
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)
Note:
Error message:
"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.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()"
Comments (7)
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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
bobtheko
Sep 06, 2022 16:22
This seemed like an incorrect error message. I had a syntax error in a completely different file, which caused this issue. Fixing the error in the unrelated file fixed this issue for me.
spinnylights
Jan 27, 2021 15:48
I am having this issue in 2019.3.14f1 on Linux with a project migrated from 2018.2.21f1.
smokykitty0
Jul 08, 2020 10:15
Same problem in Unity 2019.2.17f1. Not resolved.
junkjp
Jun 20, 2020 12:21
I have the same problem in 2019.3.15f1
havoclamperouge
Mar 01, 2020 01:48
This continues to happen with the 2019.2.13f1 Unity
Crisby
Nov 29, 2019 02:30
I have the same problem in 2019.1.0f2
nymapat
Apr 05, 2019 07:35
i have this problem in unity 2018.3.11f