Search Unity

Question What is unused override and when does it matter?

Discussion in 'Prefabs' started by huulong, Sep 15, 2022.

  1. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    224
    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:
    https://issuetracker.unity3d.com/is...pt-component-is-registered-as-unused-override

    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.

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

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

    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?
     
    io-games likes this.
  2. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,026