Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Feedback Show Prefab Overrides

Discussion in '2021.2 Beta' started by BOXOPHOBIC, May 24, 2021.

  1. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    508
    Hi there,

    Regarding showing that a prefab has overrides, is a great addition! But I think the transform overrides should be ignored. Having everything highlighted as having transform overrides is as useful as showing nothing.
    In my opinion, transforms should not be taken into consideration as overrides at all (maybe I don't see the bigger picture). I hope you see my point.

    upload_2021-5-24_12-13-37.png

    Cheers!
     
  2. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    301
    I can see your point. This would be especially annoying when working with UI prefabs, as their values are constantly changing
     
    Prodigga likes this.
  3. howardmealor

    howardmealor

    Unity Technologies

    Joined:
    May 21, 2021
    Posts:
    18
    Hi BOXOPHOBIC,

    Can you please tell us what operations you made to arrive at the state your screenshot shows? Was it by manually changing the scale of your objects or did the Hierarchy indicators appear after an import or upgrade?

    This Hierarchy feature is meant to indicate non-default overrides and basically headline the blue verticals which would be shown in the Inspector. Position and rotation are considered default overrides but Unity has never treated scale as a default override. The Inspector therefore marks scale overrides with the blue vertical line.

    Here's how the Unity documentation describes default overrides: https://docs.unity3d.com/ScriptReference/PrefabUtility.IsDefaultOverride.html
     
    Last edited: May 27, 2021
    LeonhardP likes this.
  4. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    508
    Hi there. Thanks for getting back. The prefabs are indeed scaled and the indicator works as expected.
    This is not the issue, what I don't understand, is why the scale is treated as an override in general. As I stated, maybe I don't see the bigger picture. In a regular scene, you might have all prefabs scaled.



    I actually show a warning in one of my scripts if a prefab has overrides, and I was intrigued to find out that IsDefaultOverride doesn't take scale into account :D

    upload_2021-5-27_18-40-50.png

    upload_2021-5-27_18-31-1.png

    Kind regards
     
    cirocontinisio likes this.
  5. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    508
    Just a small addition. I know that scale is a special case:
    - If a prefab A has a scale override, it will not take the scale of prefab B if you apply the override
    - If prefab A doesn't have the scale override, it will take the prefab B scale if that is changed
     
  6. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    IMO scale should be kept as prefab override as I use it for a lot of model prefabs, so it's pretty useful to update the base variant's scale and have that update trickle down to child variants and scene instances.
     
  7. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    Do note that for UI prefabs (i.e. RectTransform), most of the properties that dictate position and sizing are default overrides:
    https://docs.unity3d.com/ScriptReference/PrefabUtility.IsDefaultOverride.html

    However, pure Scale in the RectTransform is also not default like it's not in regular Transform, since it has a different meaning than Size and is used very rarely to control the size of UI elements (and in fact it's silly to do it that way, should be mostly used as a multiplier to create small feedback tweens).

    Now whether scale should be a default override in general, that is a matter of discussion and I'll let you continue on it :D
     
    Ruchir likes this.
  8. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    I can clearly remember that discussion happening during the development process for nested prefabs, and both things being tried. There was a bunch of community feedback. Can't remember if that thread happened in the prefab forum or in a beta forum, though.
     
  9. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    508
    It is indeed a bigger topic and totally unrelated to the hierarchy indicator. But still, having everything highlighted there is quite useless for art prefabs but useful for other gameplay-related prefabs...
     
  10. howardmealor

    howardmealor

    Unity Technologies

    Joined:
    May 21, 2021
    Posts:
    18