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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Invalid AABB aabb

Discussion in 'UGUI & TextMesh Pro' started by BenouKat, Oct 16, 2015.

  1. BenouKat

    BenouKat

    Joined:
    Feb 29, 2012
    Posts:
    222
    Hi guys,

    I'm facing a difficult problem in UI. I know that Invalid AABB aabb is a common issue but I didn't found my case and any solution I tried have failed.

    My situation :

    I got a Vertical Group Layout with a Content Size Fitter (set in Preferred in Vertical). Inside, I got multiple gameObject which contains a Text component, and a Layout Element component.

    What I want to do : I need to disable all Text component when they go out of the mask (because reasons). But I need that the RectTransform keep its size, the whole list should not move.

    What I do : I instanciate all Texts, I set their rect.height and rect.width in the "peferred width/height" into the Layout Element component, then I disable the Text component. So the Rect Transform keeps it size even if I disable the Text component.

    What i got : Invalid AABB aabb each time I disable the Text component. What is strange is : If I uncheck the component in the editor : it's okay, but if I did it in the code : boom.
    First time I thought it was because the text was height = 0. And I know that Unity UI doesn't like it.
    But I set first the preferred values into the Layout Element, and when I check the editor, nothing is at 0 width or height.

    Someone have a solution ? I'm on Unity 5.1.3p3, if someone can confirm this will not happen in 5.2+, i'm ok with this, but if there's a way to fix this in the version, I take it.

    Thanks a lot !
     
  2. jcredible

    jcredible

    Joined:
    Dec 4, 2012
    Posts:
    24
    Hi @BenouKat , I too ran into this issue. See my topic here for details: http://forum.unity3d.com/threads/5-1-3f1-invalid-aabb-aabb-error-what-does-this-mean-devs.357716/

    I believe this is a combination of the amount of content and some specific layout. I haven't upgraded to 5.2 yet because of the bugs (waiting on 5.2.2) so I can't confirm if it doesn't happen yet... For 5.1.3 it does happen though when I set it an object to inactive. Last night it happened when I was scrolling through a scrollrect with a lot of elements.

    I filed a defect that I think reproduced it with QA a number of weeks ago but they haven't responded yet. I was planning on waiting another week or two then asking @phil-Unity if he had any ideas. I'm seeing this issue quite a lot in various scenarios.

    Feel free to open up a bug report if you find a simple case that reproduces it. Mine was a bit more complicated as it involved some custom scripts (a graph). What's worse is that graph used a linerenderer which uses the old OnFillVBO function, so the project won't work for 5.2.x out of the box :(
     
    Last edited: Oct 16, 2015
  3. jcredible

    jcredible

    Joined:
    Dec 4, 2012
    Posts:
    24
    FYI - this seems to be fixed in 5.2.2. However, I'm not 100% sure if it's just the fact that Unity is now being much better about their batching. Regardless, the amount of vertices has dropped significantly and the problem went away. Great job UI-team!
     
  4. BenouKat

    BenouKat

    Joined:
    Feb 29, 2012
    Posts:
    222
    Thx for your post, I managed it another way, I'm waiting to go on 5.2 for simply everything :)
     
    jcredible likes this.