Search Issue Tracker




Found in


Issue ID




Cannot add assets to a ScriptableObject asset with AssetDatabase.AddObjectToAsset



In case the main Asset is a ScriptableObject, AssetDatabase.AddObjectToAsset (subObj, mainAsset) "mixes up" incoming parameters and adds the scriptable obj to a sub object

Expected: Vice versa.

Comments (18)

  1. 49d76b6035b403e1e7a34fe7ec8de79f?d=mm


    Sep 11, 2020 04:58

    Not fixed, I'm having this issue in 2019.4.7f1...

  2. 6ddeb6c2732c0b28d8aeb1955ef1eda1?d=mm


    Sep 06, 2016 23:11

    I have reproduced the bug and reported it . Also produced workarounds so you can pin point the bug and fix it fast. Looking forward to the fix :)

  3. 7fb545016e6564beeae4544995d043d1?d=mm


    Aug 17, 2016 14:10

    Note: If anyone are still seeing this bug, we need a new bug report for it. The repro steps and project attached to this specific bug report do no longer reproduce any problem, so if a bug is still there, it only manifests itself in a different way that we don't have a bug report for and don't currently know how to reproduce.

  4. Cfb46e0964856529dad893ce42d525da?d=mm


    Aug 12, 2016 09:03

    Still not fixed as of 5.4.
    Hiding or naming sub assets so that they're automatically placed further in sorting order still works as a hack.
    A neat enough fix is to prefix the name of all sub assets with the name of the master asset.

  5. 2dfb23204c2e939baffa10c5e3790cb6?d=mm


    Jun 07, 2016 20:56

    Bug not fixed. Getting this issue in 5.3.4f1.

    The child asset comes the parent and therefore breaks the database.

  6. 5bf8f46fa088e935bde044785ba73a2d?d=mm


    Jun 06, 2016 14:33

    Bug Not solved. Sub asset become main asset. U 5.3.5p2 (trick with sorting algorithm working - 0mainAsset and 1subAsset...but it's terrible!)

  7. B797449429747ef4341b4939a00b2ce8?d=mm


    Apr 21, 2016 09:10

    The only thing that makes it kind of work (unusable though) is to give it a special name, that makes the sorting algorithm put it to the front like 0mainAsset, but if you have a subasset whose name starts with something that gets sortet before that, like 0asset you're out of luck.

  8. B797449429747ef4341b4939a00b2ce8?d=mm


    Apr 21, 2016 08:57

    I still have this issue even when i change the name before adding it to the mainAsset.

  9. 4b557aa04a755c16640a676cfa03f6f8?d=mm


    Apr 20, 2016 05:10

    Update: It does seem to work if I change the name of the Scriptable Object before adding it. Yay!

    Yep, I can confirm. The bug persists if no name is given to the ScriptableObject. If the object has a name before being added the hierarchy works. If there is no name the hierarchy becomes messed up.

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.