Prefab overrides not being detected

I have two prefabs: A and B (B is a prefab variant). A is a child of B. The children of prefab A inside of prefab B have different sizes than root prefab A; yet Unity does not detect this as an override and thus I can’t revert it to restore the original prefab sizes.

If I remove prefab A from prefab B and re-add it, everything works as expected (except Unity now treats A as an override in B, even though A is present in the B’s root prefab).

There are 3 different levels of context:

  1. Prefab A
  2. Prefab B that has an instance of Prefab A inside it
  3. The scene context that has an instance of Prefab B inside it.

If you modified Prefab A in the scene context, then that will only override Prefab B in the scene. If you then go inside the context of Prefab B, you will not see any overrides there.

While on the other hand, if you modified it in the context of Prefab B, then that will only override Prefab A in Prefab B. While in the scene hierarchy you will not see any overrides.

So make sure you are looking at the correct context.

I’m making changes in prefab mode, not in the scene (these prefabs are instantiated at runtime, not initially present in the scene).

Can you show screenshots of the hierarchy and inspector?

I fixed all but one of these issues by replacing the prefab. I did save one for a repro and when going back through it I think I found the issue in this particular case: Since prefab B is a variant, overrides to prefab A were based on the instance of prefab A that exists in the prefab B’s base prefab; rather than being based on prefab A’s base prefab, as I was expecting.

So I had to revert overrides in B’s base instead of trying to revert them in the prefab B variant.

There were some other issues with other prefabs I was having that I don’t think were related to this - I should have documented them before fixing them though, because now I don’t remember exactly what was happening.