What is unused override and when does it matter?

I’ve noticed a new “Unused overrides” section in the Overrides menu and mentions to it in the PrefabUtility API (since 2021 or 2022). However, there is no mention of it in the documentation, and searching “unused override” in a search engine surprisingly finds very few results.

Could you explain what they are, and add this information to the official documentation too?

From what I understand, they represent properties on old components that you saved on prefab instances (or variants) just in case they would reappear later. But it turns out, reading this fixed issue:

that missing script will have their overrides cleared, so this case shouldn’t really happen.

I manage to accidentally get Unused overrides after manipulating an object in a very particular way that I don’t exactly remember (create prefab, close Unity, change script and clear library, reopen Unity, drag prefab in new scene, close scene and open a new one that already had prefab instance…)

The prefab instance was shown with the usual override blue bar on the left, but no property was changed (blue) in the inspector. Clicking on Overrides then showed a new “Unused overrides” section.

8442626--1119143--2022-09-15 override blue bar near clean prefab instance.png

8442626--1119146--2022-09-15 no override in inspector visible.png

8442626--1119140--2022-09-15 unused overrides local transform after particular manipulation.png

If I click on Remove, it will log in the Editor logs:

Maybe because my object is at the root, local position and root order is unused?
In any case, it seems safe to remove those overrides, as they are unused, as they say.

Are they situations where it is worth keeping them though?

1 Like