Search Unity

Prefab variant reorders components

Discussion in 'Prefabs' started by Epsilon_Delta, Dec 26, 2019.

  1. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    258
    Hello,

    I have an issue with prefab variants and want to know if somebody knows more. I use 2019.3 version of Unity.
    What is happening: when I add multiple (say three) components on a prefab variant in prefab mode, then saving, leaving and reentering prefab mode on that prefab variant, the components that I added are in different order

    Has anybody experienced similar issue?
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    Is this reordering causing other problems or is it merely a "visual issue" in the Inspector?
     
  3. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    258
    In my case it is just inconvenient behavior, as I would like to have "main component" or component that I modify most often on top. However, I can see there might be problems when one expects some order of components when accessing from code. And then, there might be problems that I cannot foresee and those are the main source of my fears :D
     
  4. olejuer

    olejuer

    Joined:
    Dec 1, 2014
    Posts:
    211
    Bump.
    This can indeed be a problem.
    Also, I don't understand, why I cannot reorder components that I added to a prefab variant manually, as long as they come after the components of the base prefab. I can reorder added gameobjects that way, so why not components?
    The workaround is deleting and adding components in the desired order. But this is, of course, not very efficient. It does suggest, though, that reordering components should technically be possible.
     
  5. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Just running into this too, seems like an odd thing to ignore. Sure the order might not affect the result at all but it would be nice to be able to organise your prefabs.