Search Unity

Invalid AABB inAABB??

Discussion in 'Editor & General Support' started by gaglabs, Oct 30, 2020.

  1. gaglabs

    gaglabs

    Joined:
    Oct 17, 2019
    Posts:
    185
    I get this error after pusing some data to Firebase. Not sure what is going on here but it just started.


    Invalid AABB inAABB
    UnityEngine.CanvasRenderer:SetMesh(Mesh)
    TMPro.TextMeshProUGUI:GenerateTextMesh() (at Library/PackageCache/com.unity.textmeshpro@3.0.1/Scripts/Runtime/TMPro_UGUI_Private.cs:4373)
    TMPro.TextMeshProUGUI:OnPreRenderCanvas() (at Library/PackageCache/com.unity.textmeshpro@3.0.1/Scripts/Runtime/TMPro_UGUI_Private.cs:1647)
    TMPro.TextMeshProUGUI:Rebuild(CanvasUpdate) (at Library/PackageCache/com.unity.textmeshpro@3.0.1/Scripts/Runtime/TextMeshProUGUI.cs:224)
    UnityEngine.Canvas:ForceUpdateCanvases()
    SocialApp.<TestEnumerator>d__21:MoveNext() (at Assets/SocialAppTemplate/Scripts/Loaders/FeedsDataLoader.cs:252)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    SocialApp.FeedsDataLoader:OnFeedsLoaded(FeedCallback) (at Assets/SocialAppTemplate/Scripts/Loaders/FeedsDataLoader.cs:222)
    SocialApp.<>c__DisplayClass93_0:<GetFriendsFeedsAt>b__5() (at Assets/SocialAppTemplate/Scripts/Controllers/FirebaseController.cs:1762)
    <ActionWrapper>d__4:MoveNext() (at Assets/SocialAppTemplate/Scripts/UnityMainThreadDispatcher/UnityMainThreadDispatcher.cs:61)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    <>c__DisplayClass2_0:<Enqueue>b__0() (at Assets/SocialAppTemplate/Scripts/UnityMainThreadDispatcher/UnityMainThreadDispatcher.cs:46)
    UnityMainThreadDispatcher:Update() (at Assets/SocialAppTemplate/Scripts/UnityMainThreadDispatcher/UnityMainThreadDispatcher.cs:34)

     
  2. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    Hey @gaglabs,

    This can be caused for having a NaN (not a number) value on one of your UI elements.

    Can you check in the Editor if one or more of your UI elements have such type of value in their properties?
     
    SZtamjan and vonSchlank like this.
  3. gaglabs

    gaglabs

    Joined:
    Oct 17, 2019
    Posts:
    185
    Hey Diego, yes my content panel of my ScrollView is returning NaN. The error seems to point to a Canvas.ForceUpdateCanvases section of my code. I am also getting some errors of Not Allowed during Rebuild Loop at the same time as the AABB error. I think when i call

    Code (CSharp):
    1.  LayoutRebuilder.MarkLayoutForRebuild (_textLookPanel.transform as RectTransform);
    2.             LayoutRebuilder.MarkLayoutForRebuild (_textCont as RectTransform);
    3.             _textCont.GetComponent<VerticalLayoutGroup>().SetLayoutVertical();
    4.             Canvas.ForceUpdateCanvases();
    Its causing the content to not resize properly cause its stuck in this loop. But i need my content panel to resize after i load in objects as its child. and we all know that the content size fitter doesnt always do its job so you have to force update its transform and thats what im trying to do but it doesnt like it sometimes.
     
  4. gaglabs

    gaglabs

    Joined:
    Oct 17, 2019
    Posts:
    185
    @DiegoDePalacio This is what i get when rebuilding the content after adding new gameobjects to the list of children. I dont get why its throwing itself into a loop like this when its only being called once.

     
    KIMYEONGGYU likes this.
  5. gaglabs

    gaglabs

    Joined:
    Oct 17, 2019
    Posts:
    185
    I removed the Canvas.ForceUpdateCanvases since i was calling it twice, and the issue seemed to go away. I think it caught itself in a loop while trying to execute 2 rebuilds and ended up not factoring its scale in between calls.
     
  6. gaglabs

    gaglabs

    Joined:
    Oct 17, 2019
    Posts:
    185
    I lied, it didnt get fixed.
     
    ZonexGamingNetwork likes this.
  7. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    Maybe you can try to isolate the problem by removing assets/scripts on your scene to reach a minimum setup where you can find out the root of the issue.
     
  8. gaglabs

    gaglabs

    Joined:
    Oct 17, 2019
    Posts:
    185
    Thats actually what i did Diego. I found the issue. I was adding tmp text field while a rebuid was active and it didnt like that.
     
  9. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    I'm glad that you found it!

    In that case, if you avoid such a situation you don't have the issue anymore?
     
  10. headcoach_

    headcoach_

    Joined:
    Jul 25, 2020
    Posts:
    3
    I'm getting the same error when activating a parent gameobject of some UI elements. Its not breaking anything but its really annoying seeing the error there
     
  11. LilGames

    LilGames

    Joined:
    Mar 30, 2015
    Posts:
    569
    I started getting this error after doing lots of texture and sprite atlas optimizations. How do I narrow down the cause? I don't use any code related to meshes or forced canvas updates, etc.
     
  12. drgrandayy

    drgrandayy

    Joined:
    Dec 7, 2022
    Posts:
    4
    Posting my edge case here in case it ends up being helpful to anyone with the same issue. In my case the cause was trying to access a removed component on a prefab variant. Calling GetComponent<>() when no component of that type exists usually just returns null, but calling it on a prefab variant with a removed component that's present on the parent prefab still returns a non-null component with what seems to be a broken transform, which leads to this unhelpful error being printed. Good to note that this is on an older Unity version (2021) which doesn't support fully deleting components on prefab variants. I believe this is now supported on the latest Unity version.