Every prefab variant is born with 11 overrides
Create a prefab variant in Unity. Change nothing. Open the file in a text
editor and you will find eleven entries already sitting in
m_Modifications — twenty-one if the root object carries a
RectTransform. Any tool that counts overrides without knowing this is
reporting a number that starts at eleven and means nothing.
A newly created Unity prefab variant contains 11 overrides before
you edit anything: m_Name (1), m_LocalPosition x/y/z (3),
m_LocalRotation x/y/z/w (4) and m_LocalEulerAnglesHint
x/y/z (3). If the root object has a RectTransform the count is 21,
adding m_AnchorMin, m_AnchorMax,
m_AnchoredPosition, m_SizeDelta and m_Pivot
(x and y each). m_LocalScale is not among them and stays
inherited from the base prefab.
Reproducing it
Set Project Settings → Editor → Asset Serialization to
Force Text. Create an empty GameObject, drag it into the Project
window to make a prefab, then right-click that prefab and choose
Create → Prefab Variant. Do not open the variant. Do not touch it.
Open the resulting .prefab file in a text editor.
The file is short. It contains a PrefabInstance block, and inside
it an m_Modifications list with eleven entries.
--- !u!1001 &100100000
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4..., guid: ..., type: 3}
propertyPath: m_Name
value: MyVariant
objectReference: {fileID: 0}
- target: {fileID: 4..., guid: ..., type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
...
What the eleven are
One name and ten transform components, in three groups:
| Property path | Count | Why |
|---|---|---|
m_Name |
1 | The variant is a different asset with a different filename. |
m_LocalPosition.x / .y / .z |
3 | Root placement must belong to the variant, not the base. |
m_LocalRotation.x / .y / .z / .w |
4 | Rotation is serialized as a quaternion — four scalar components. |
m_LocalEulerAnglesHint.x / .y / .z |
3 | The Inspector's remembered euler values, kept in step with the quaternion. |
One plus three plus four plus three is eleven. Note what is not in the
list: m_LocalScale. Scale is inherited from the base like any other
property, which is worth remembering the next time a variant refuses to pick up a
scale change and you assume the transform block is overridden wholesale. It is not.
Position and rotation are; scale is not.
Unity forces the m_Name of a prefab's root GameObject to
match the asset filename, regardless of what the serialized override says.
Rename the file and the root follows. This does not apply to child objects,
where the serialized name is authoritative. A parser that trusts
m_Name on the root will occasionally disagree with the Editor.
Twenty-one when the root is a RectTransform
Make the same empty variant, but from a prefab whose root is a UI object — a Canvas child, an Image, anything with a RectTransform. Now the count is twenty-one.
The eleven above are still there. On top of them sit ten more, because a RectTransform positions itself with a different set of fields:
| Property path | Count |
|---|---|
m_AnchorMin.x / .y | 2 |
m_AnchorMax.x / .y | 2 |
m_AnchoredPosition.x / .y | 2 |
m_SizeDelta.x / .y | 2 |
m_Pivot.x / .y | 2 |
Eleven plus ten is twenty-one. The rule underneath is consistent: Unity detaches the root's own placement from the base so that a variant can be positioned independently, and for a RectTransform "placement" means anchors, pivot and size as well as position.
The second thing RectTransform breaks
While you are here: in the serialized format, Transform is class
ID 4 and RectTransform is class ID 224. Both carry
m_Father and m_Children. Both define hierarchy.
A parser that walks the file looking for !u!4 to reconstruct the
object tree will build a perfectly correct hierarchy of everything except the
entire UI, which will appear as a set of orphaned roots. This is an easy bug to
ship and a hard one to notice, because it only shows up in projects with UI
prefabs — which is to say, in real projects and not in your test fixtures.
Why this matters for tooling
Two consequences follow, and they are the reason this article exists.
Override counts need a baseline. "This variant has 14 overrides" is not a statement about your team's decisions. Eleven of those are bookkeeping Unity did at creation time; three are yours. A report that does not subtract the baseline will rank a pristine variant as more modified than a deliberately tuned one, and every number it produces will be wrong in the same direction.
The baseline is not a constant. It is eleven or twenty-one depending on the root's transform type, so you cannot subtract a fixed number. You have to determine what the root actually is before you can say what is ordinary and what is intentional.
Once you account for both, a variant chain becomes readable. Before that, the blue override markers in the Inspector are just noise with a colour.
Frequently asked questions
How many overrides does a new Unity prefab variant have?
Eleven, if the root object has a Transform: one for m_Name, three for m_LocalPosition, four for m_LocalRotation, and three for m_LocalEulerAnglesHint. If the root has a RectTransform the count is twenty-one, because anchors, anchored position, size delta and pivot are added.
Why does Unity write overrides into a variant I have not edited?
So the variant's root placement is independent of its base. Position and rotation of the root are detached at creation time. Scale is not — m_LocalScale stays inherited.
Is m_LocalScale included in the default overrides?
No. Scale is inherited from the base prefab like any other property, which is why a scale change on the base does propagate to variants while a position change does not.
Why does the Inspector show a different override count?
The Inspector counts every override, including the ones Unity wrote at creation. Subtract eleven (or twenty-one) to get the number of overrides your team actually made.
This is the behaviour Dead Overrides is built around: it separates the overrides Unity wrote from the overrides your team wrote, then reports which of the latter are redundant, stale or shadowed.
Counts observed on Unity 2022.3 LTS and Unity 6. If you see different numbers on another version, we would like to know — support@voxcub.com.