Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Trying to add (layout rebuilder for) Display Area

Discussion in 'Scripting' started by FisherM, Dec 28, 2015.

  1. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    Hey I'm getting the following error
    http://prntscr.com/9jhc8f
    "
    Tring to add (LayoutRebuilder for) Display Area (UnityEngine.RectTransform) for layout rebuild while we are already inside a lout rebuild loop. This is not supported
    "
    I don't quite understand what is meant by the error message, I have found people saying this may come from having multiple canvases or layout groups in a scene. I have only one canvas and it seems a little strange if unity's layout groups simply don't work.
    Any description or help on this issue would be appreciated. The error occurs when loading scenes including startup.

    Cheers
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,773
    I have recently starting getting this error message as well. We have multiple canvases and many layout groups, but our project has always had those with no errors up to now - and it doesn't seem to impact the functionality at all, just throws a bunch of errors to the console.
     
  3. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    5.3 By the way
     
  4. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    Still looking for help with this
     
  5. CxydaIO

    CxydaIO

    Joined:
    May 12, 2014
    Posts:
    61
    having this error too. It Worked fine in 5.2 :(
     
  6. ted-aronson

    ted-aronson

    Joined:
    Dec 28, 2015
    Posts:
    8
    I've seen these errors before, and they seemed to come from the Scroll Areas I was using in my UI. To disable the errors, I made all the scrollbars in the scene either Permanent or Auto-Hide. It seems Auto Hide And Expand Viewport was causing this issue. I have no idea why, though.

    Image 008.png

    Hope that reduces some of your error spam at least! Sorry I don't have a more permanent solution.
     
  7. mustafa

    mustafa

    Joined:
    Jun 4, 2012
    Posts:
    24
    Thank you. This cleaned my console.

    Did someone already "Report a Bug" about this?
     
  8. bedorlan

    bedorlan

    Joined:
    Aug 16, 2015
    Posts:
    18
    Outstanding! how do you come up to this?
     
  9. ted-aronson

    ted-aronson

    Joined:
    Dec 28, 2015
    Posts:
    8
    Experimentation, mostly! I was getting this error a bunch:

    Trying to add (LayoutRebuilder for) Content (UnityEngine.RectTransform) for layout rebuild while we are already inside a layout rebuild loop. This is not supported.
    so I renamed all the objects named Content in my scene to various unique names. That helped me figure out the problematic elements pretty quickly. Then I figured that this error was happening when things were getting resized/rebuilt, so I just futzed with whatever control I could find that had to do with resizing/rebuilding things on the fly.
     
  10. Hodgson_SDAS

    Hodgson_SDAS

    Joined:
    Apr 30, 2015
    Posts:
    123
  11. ExNinja

    ExNinja

    Joined:
    Dec 4, 2013
    Posts:
    30
    All my ScrollRects are set to have permanent scrollbars, and I still get the error. :/
     
  12. Gaspar

    Gaspar

    Joined:
    Jun 14, 2014
    Posts:
    28
    Try to fill "ViewPort" property in your ScrollRect as it expected in new version of Unity
     
  13. lassade

    lassade

    Joined:
    Jan 27, 2013
    Posts:
    127
    I don't have scroll bars but still getting this error. Any idea?
     
  14. remption

    remption

    Joined:
    Jun 1, 2014
    Posts:
    10
    Yeah, I'm getting the error as well - no scroll bars, filling the ViewPort didn't help... It's saying this line of code is the cause of the error:
    scrollRect.verticalNormalizedPosition = 0.0f;//scroll back to the top
     
  15. DragonRider

    DragonRider

    Joined:
    Jul 19, 2012
    Posts:
    11
    Having this issue since 5.3 as well.
    They're working on it:
    Going to download the patch release now to check if it's fixed completely.
     
  16. Tenspell

    Tenspell

    Joined:
    Sep 18, 2012
    Posts:
    2
    The patch fixed some of my errors, I'm still getting this issue on a UI.Text and UI.Image when I attempt to call SetActive(false) on their gameobjects.
     
  17. Gru

    Gru

    Joined:
    Dec 23, 2012
    Posts:
    142
    For me, this issue has been fixed in 5.3.3.f1
     
  18. Julien-Lynge

    Julien-Lynge

    Joined:
    Nov 5, 2010
    Posts:
    142
    Was having this issue due to a weird combination of layout elements and content size fitters. Upgrading from 5.3.2 to 5.3.4 seemed to fix it.
     
  19. felixpk

    felixpk

    Joined:
    Nov 7, 2013
    Posts:
    17
    For me it seems like the Content Size Fitter is throwing the Exception
     

    Attached Files:

  20. prasetion

    prasetion

    Joined:
    Apr 3, 2014
    Posts:
    28
    wow, thanks for help @felixpk , i remove that component and the error was gone in console
     
  21. yaoyao2016

    yaoyao2016

    Joined:
    May 23, 2016
    Posts:
    1
  22. antx

    antx

    Joined:
    Feb 16, 2012
    Posts:
    28
    I just downloaded 5.6 imported my project and while running it I get plenty of those (see picture):



    I get these the first time I set an UI-GameObject (scrollrects, layout groups and contentsize fitters in them) active. Almost none of the UI is visible then. When I deactivate and activate this gameObject again it works as it should.

    I used 5.4 before and had no problems there.
     
  23. AdventureproGames

    AdventureproGames

    Joined:
    Feb 4, 2015
    Posts:
    5
    Yes, this has started happening in 5.6 for me as well. Was not occurring before.
     
  24. MAWMatt

    MAWMatt

    Joined:
    Nov 10, 2016
    Posts:
    77
    I just installed patch 5.6.0p1 which was released yesterday, the issue is still present. I have no content fitters, my ViewPort is assigned within the ScrollRect. When I open that window and everything turns on, it's there for a few moments then vanishes with the error spam.

    I guess for now just rollback to a previous version of Unity (5.5 was working fine, for instance) until Unity rectifies this..
     
  25. Discord

    Discord

    Joined:
    Mar 19, 2009
    Posts:
    1,008
    Did you figure out a workaround for this issue?