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

Scripting

-

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.

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

Comments (26)

  1. unity_K99WJS2TxGpRtA

    Apr 11, 2020 11:33

    I like this post,And I guess that they having fun to read this post,they shall take a good site to make a information,thanks for sharing it to me.
    xosovui.net/xsmb https://www.artfire.com/ext/people/xosovuiss

  2. unity_K99WJS2TxGpRtA

    Apr 10, 2020 12:54

    I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post.
    cupons de desconto amazon https://audiomack.com/artist/cupomatoss

  3. unity_K99WJS2TxGpRtA

    Apr 07, 2020 10:33

    This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information...
    Looking for a hacker near me https://blackrockconsultpro.com

  4. unity_K99WJS2TxGpRtA

    Apr 05, 2020 18:12

    This is such a great resource that you are providing and you give it away for free.
    Rèm văn phòng giá rẻ https://www.artfire.com/ext/people/thegioiremxx

  5. unity_K99WJS2TxGpRtA

    Apr 05, 2020 15:50

    Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.
    Rèm văn phòng https://www.artfire.com/ext/people/thegioiremxx

  6. unity_K99WJS2TxGpRtA

    Apr 02, 2020 09:55

    I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,..
    Sol Control Custom https://www.solcontrolcustomsandtint.com/

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.