The objects in the variant of my Prefab lost their positions when I change hierarchy in original prefab. There are steps to reproduce: 1. Create "Head Bot" prefab 2. Create "Head Bot Variant 1" prefab from "Head Bot" 3. Create an empty GameObject in "Head Bot" and Put legs into GameObject 4. Put Right leg and Left leg into GameObject Aaaaaand, what happens with "Head Bot Variant 1" after the last step ??? The screenshot is in next post.
I think what happens is this: When you reparented the right leg and left leg under the new GameObject, their local positions changed. Unity does this when reparenting in order to keep the world positions the same. However, what actually gets stored (and what is shown in the Inspector) is the local positions. So the local positions in the base Prefab changed in order to compensate for the different position of their parent. However, the positions of the right leg and left leg in the Prefab Variant are overridden, so didn't get updates from the base Prefab. They still got a new Parent GameObject, but didn't get their positions updated to compensate for the different position of the new parent. While this is all logically consistent in the system, I can see how it's quite confusing. I'm not sure what can be done about it. I'm not completely sure the above is what happened to you; it's hard to say without access to the project, since it depends on the exact positions of the various objects.
@runevision It's a huge problem. Just imagine, you have a deep structured object and few variants of that prefab. In some moment you understand that better to change hierarchy in original prefab. If you do that all variants and nested prefabs with overrides could be broken. I guess better add to the prefab overriding system ability to change override options for Transform: override local position from prefab root override local position
I understand it can indeed be a big problem. We're probably not going to do a whole revamp of how Transforms work to solve this issue; this would have huge implications for a ton of things. Transforms today always store local position (relative to parent), not world position or relative to any other object. But we will try to figure out if there could be some other solution to this problem.
I'm happy to hear that but ... we didn't change anything related to this as far as I know, so I'm a bit stumped why it works better now.