Search Unity

Animating TMP Color/Font Color, causes IndexOutOfRangeException

Discussion in 'UGUI & TextMesh Pro' started by Vince-Chimp, Feb 18, 2021.

  1. Vince-Chimp

    Vince-Chimp

    Joined:
    May 28, 2018
    Posts:
    43
    When we try to use the unity animator to anime either Color or Font_Color on a TMPro object, it starts throwing the following error:

    Code (CSharp):
    1. IndexOutOfRangeException: Index was outside the bounds of the array.
    2. TMPro.TMP_Text.FillSpriteVertexBuffers (System.Int32 i, System.Int32 index_X4) (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TMP_Text.cs:6819)
    3. TMPro.TextMeshProUGUI.GenerateTextMesh () (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TMPro_UGUI_Private.cs:3905)
    4. TMPro.TextMeshProUGUI.OnPreRenderCanvas () (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TMPro_UGUI_Private.cs:1654)
    5. TMPro.TextMeshProUGUI.UpdateSDFScale (System.Single scaleDelta) (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TMPro_UGUI_Private.cs:4585)
    6. TMPro.TextMeshProUGUI.InternalUpdate () (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TMPro_UGUI_Private.cs:1573)
    7. TMPro.TMP_UpdateManager.DoRebuilds () (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TMP_UpdateManager.cs:153)
    8. UnityEngine.Canvas.SendWillRenderCanvases () (at <6df2bf6e7bc1499cbb0f04556df8b702>:0)
    I can't figure out what it is or why it happens, i tried to isolate it as far as i can, and it seems that when all references in the animations to Color are removed, the screaming stops. But it is highly inconvenient that this doesn't work.

    We are on Unity 2019.4.16f1 with TMPro 2.1.3.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    New TMP releases should be available tomorrow / later today so I suggest you wait for version 2.1.4 to be available and see if you still get the same issue with the new release.

    If you do get the same issue, then please submit a bug report with project and I will be more than happy to take a closer look.
     
  3. Vince-Chimp

    Vince-Chimp

    Joined:
    May 28, 2018
    Posts:
    43
    Just to note, this seems to have fixed the issue with the new version!