Search Issue Tracker
By Design
Votes
0
Found in
2019.3.0a7
Issue ID
1164124
Regression
No
Can't assign missing script to a prefab if an asmdef is present in the folder
1. What happened
Trying to fix missing script component within a prefab in isolation mode will complain about scripts that are not derived from monobehavior.
2. How we can reproduce it using the example you attached
1. Load the attached project or add the assets to an existing one
2. Select the Cube.prefab asset in the project and open the prefab (Isolation mode)
3. Try to assign script A and B to the missing script component on the prefab
Note that the warning doesn't go away when assigning a script to the slot
4. Try to leave Isolation mode and click on the Save button when prompted
Result: A "Save Failed" dialog will pop up and after clicking the okay button, error will be printed in the console about the scripts we assigned don't derive from MonoBehaviour
Deleting the AsmDef.asmdef asset from the project will make the warning go away and we'll be able to save the changes to the prefab
This is reproducible in all Unity versions since the implementation of Nested Prefab and its Isolation mode. Before, we were simply not able to instanciate a prefab in the scene that has missing scripts in it.
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
- UI Toolkit meshes are fully rendered and rasterized when opacity is 0
- Light rendering artefacts appear in the Editor when assigning unsupported 3D Custom Render Texture in Camera’s Output Texture, unclearable errors and warnings spammed
- Memory leak when running a test with "GfxThreadingMode" set to "SplitJobs"
- Loading Unloaded unsaved Scene throws “ArgumentException” error in the Console
- Crash on std::__1::__tree_const_iterator when opening the Build Profiles window in a specific project
Resolution Note (2020.1.X):
By design. The scripts in this project are editor only scripts because the asmdef is only compatible with the ditor.
If you try to attach the scripts to a regular game object by dragging into one in the Hierarchy, you will get dialog saying "Can't add script. The script is an editor script".