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
- 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
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".