Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Disabling layout groups on prefabs corrupts layout of prefabs containing them

Discussion in 'Prefabs' started by bartofzo, Jul 17, 2023.

  1. bartofzo

    bartofzo

    Joined:
    Mar 16, 2017
    Posts:
    150
    Hi,

    We have a complicated layout that was made using nested prefabs and they use horizontal and vertical layout groups to align UI items. I want to disable or remove these layout groups since they aren't needed at runtime.
    However, everytime I try to do this, the layout of the elements in prefabs (and scene) using them is completely corrupted. That is, their size becomes zero, or their alignment is way off... etc.
    For some this can be fixed by reverting prefab overrides, but for others this doesn't work. It's really unpredictable and doing everything by hand is almost undoable since there are so many of them.

    Anyone else encountered this issue? Know of a workaround?
     
  2. Peter_Olsted

    Peter_Olsted

    Unity Technologies

    Joined:
    Apr 19, 2021
    Posts:
    74
    Hi
    • Which version of Unity are you using?
    • When does this issue occur, is it when making a build that these corruptions occur?
     
  3. bartofzo

    bartofzo

    Joined:
    Mar 16, 2017
    Posts:
    150
    2021.3.21f1

    And no, it's just in the editor. When switching from one prefab view (or to scene view) to another after disabling or removing layout groups.
     
  4. Peter_Olsted

    Peter_Olsted

    Unity Technologies

    Joined:
    Apr 19, 2021
    Posts:
    74
    Ok, thank you for the info. Can you submit a bug report on this? Sounds like you got some good reproduction steps for this.