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

Order of components in prefab varients changes randomly.

Discussion in '2019.3 Beta' started by YOSSI2010, Dec 17, 2019.

?

Do you guys notice these behaviour as well?

  1. Yes, it reverts

    100.0%
  2. No, I can change order of added components in variants

    0 vote(s)
    0.0%
Thread Status:
Not open for further replies.
  1. YOSSI2010

    YOSSI2010

    Joined:
    Dec 26, 2016
    Posts:
    20
    Hi I am using Unity 2019.3.0f3 and I have encountered a weird bug regarding prefabs and component order.
    I've witnessed this bug on a few of the recent builds (even on 2019.2)
    Sometimes Unity will not allow me to reorder components, I enter prefab mode, reorder them and they get reverted.
    Even If I remove all components and add them one by one, saving each component, they would jumble again when going out of prefab mode.

    Note that this behaviour only happens in prefab variants, however all the components were added in that variant for example: I have a blender model that I use and add components to, I make a variant of that model(so changes in blender still apply) and in that prefab variant all components are marked with a "+" annotating that these are added components, yet I still can't reorder these and even if I delete these and Re-Add them they still take a random order and not the order I added them by.

    Thank you, I hope you fix it soon
     
  2. JordanSchuetz

    JordanSchuetz

    Joined:
    Jan 23, 2013
    Posts:
    7
    I'm getting this same bug, I can't find a solution,
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
  4. GameEver

    GameEver

    Joined:
    Apr 28, 2020
    Posts:
    12
    tonytopper likes this.
  5. YOSSI2010

    YOSSI2010

    Joined:
    Dec 26, 2016
    Posts:
    20
    Doesn't it also change the order of execution per object?
    I use the order of execution settings but as far as I remember the inspector order is also taken into consideration.
     
    Mild-Mania likes this.
  6. Tonio1308

    Tonio1308

    Joined:
    Sep 22, 2013
    Posts:
    7
    I have to mention that it is not a costemic issue.
    To us, it breaks our working process and best practices.
    When you're scrolling to find out where is the main component of your gameobject that it's lost somewhere in the middle of various secondary components, you gradually lose time each time.
    And when your process is based on components reusability and prefabs, you lose a lot of time.

    It is not a minor bug.
     
  7. crdmrn

    crdmrn

    Joined:
    Dec 24, 2013
    Posts:
    152
    It's not just cosmetic.
    When you have a complex system with a lot of prefabs you want to be able to reliably set up a components order for visual reasons; it saves a lot of time to find the values you need when you need to change them.
    I'm aware of the nested/variant prefab workflow, but a lot of times you still end up with a lot of prefabs that share a similar components setup, and you wont the components order to be consistent.
    And please, don't dismiss user feedback like they don't know what they're talking about; a lot of us use Unity for work, not just for free time fun ;)
     
    LookingGlassTeam and tonytopper like this.
  8. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    302
    I got this bug in 2020.3.19f1

    It is so annoying...

    Makes me not want to work with prefab variants if I have to give up control to some random ordering system.
     
  9. GameEver

    GameEver

    Joined:
    Apr 28, 2020
    Posts:
    12
    Yes, and Unity doesn't care to fix it.
     
  10. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    Bump for quality of life
     
  11. benlkabam

    benlkabam

    Joined:
    Mar 27, 2020
    Posts:
    1
    Component order does effect the order of which OnDisable/OnEnable methods are called for components on a GameObject.

    Also when you have multiple components that inherit from the same base class, and call GetComponent<BaseClass>() it will get the first one; which is certainly convenient for some coding design decisions.

    I can think of more applications off the top of my head, like: wanting to use the order of a GetComponents in an editor script to auto-populate a serialized array before runtime to avoid dragging and dropping these components.

    The point is, this not a cosmetic issue.

    These are real issues I have experienced based on certain solutions implemented before prefab variants were introduced; which now require more complex, and less optimal work-arounds in order to use prefab variants. In some cases it is less of a headache to just unpack the prefab and manually maintain each one instead of using a variant.
     
    swedishfisk likes this.
  12. gnovos

    gnovos

    Joined:
    Apr 29, 2020
    Posts:
    33
    When you have UI it matters a lot, especially if you use layout groups.
     
    forestrf likes this.
  13. modernator24

    modernator24

    Joined:
    Apr 7, 2017
    Posts:
    202
    relatively low issue? that's why you guys still haven't fixed it yet. it's really annoying.
     
  14. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    The issue has been fixed as of 2022.2.0a4. If you're encountering this behavior in later versions, please submit a bug report for it with a reproducible attached so we can investigate.
     
Thread Status:
Not open for further replies.