Search Unity

TextMeshPro NullReferenceException on MaterialReferenceManager.cs

Discussion in 'UGUI & TextMesh Pro' started by wagenheimer, Jun 7, 2022.

  1. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    323
    Unity 2021.1.28f1 for Nintendo Switch.

    I have some random errors with TextMeshPro.

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. TMPro.MaterialReference..ctor (System.Int32 index, TMPro.TMP_FontAsset fontAsset, TMPro.TMP_SpriteAsset spriteAsset, UnityEngine.Material material, System.Single padding) (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/MaterialReferenceManager.cs:525)
    3. TMPro.TextMeshProUGUI.SetArraySizes (TMPro.TMP_Text+UnicodeChar[] unicodeChars) (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMPro_UGUI_Private.cs:1042)
    4. TMPro.TMP_Text.ParseInputText () (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMP_Text.cs:1902)
    5. TMPro.TextMeshProUGUI.OnPreRenderCanvas () (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMPro_UGUI_Private.cs:1644)
    6. TMPro.TextMeshProUGUI.Rebuild (UnityEngine.UI.CanvasUpdate update) (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TextMeshProUGUI.cs:216)
    7. UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/CanvasUpdateRegistry.cs:215)
    8. UnityEngine.Canvas:SendWillRenderCanvases()
    9.  
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you see if you get the same behavior using the latest preview release which is version 3.2.0-pre.3 for Unity 2020.3 or newer?