Hi all. I’m encountering a problem where the order of GameObjects in a base prefab’s hierarchy is being rearranged in its variants. I’ve attached an image showing a simple example. Being variants, it’s not possible to correct this.
This has completely broken our UI in particular, as now sprites are being drawn in the wrong order. It’s rendered some screens unusuable. The only workaround I can see is to unpack these variants, thereby losing the benefits of the nested prefab workflow, which has been very good up until now.
Is there a way to restore the order of GameObjects in a variant to that of its base? Many thanks.
After some testing, a not-ideal fix is just to revert all changes to the affected prefab variant. (From the top part in the inspector, Overrides → Revert All) You lose all your overrides, but the hierarchy order corrects itself in the process.
Edit:You can fix the order of individual GameObjects, but inconsistently. You just need to select individual RectTransforms from the Overrides dropdown menu and revert changes to those. We’re having inconsistent results by doing this; the order of GameObjects is sometimes being changed, not always, and not necessarily to the correct order of the base prefab.
I also encountered this error. On my prefab, I also had one added, but not applied object. I applied it to the prefab, and order change started to work as expected.