Search Issue Tracker
Fixed
Votes
22
Found in
4.2.0b2
Issue ID
549533
Regression
No
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.
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Rodolfo-Rubens
Sep 11, 2020 04:58
Not fixed, I'm having this issue in 2019.4.7f1...
Shrikky23
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 :)
rune_unity
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.
ataxkt
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.
samsamm777
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.
mudart
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!)
Flavelius
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.
Flavelius
Apr 21, 2016 08:57
I still have this issue even when i change the name before adding it to the mainAsset.
ecesis_llc
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.
ecesis_llc
Apr 20, 2016 05:06
This still appears to be an issue in U5.3.4f1.
I created a ScriptableObject container and saved it to an .asset. I have another ScriptableObject class. Using CreateInstance I then add this new ScrtiableObject to the container using AddObjectToAsset. The hierarchy is all messed up in the editor. HideInHierarchy at least keeps the container visible at the root. It looked like there was a "fix" back in 5.3.3p1. But it isn't working.