I am updating a TMPro Ugui (Version 2.1.3) label and get this exception on a very different component lying in the scene and beeing hidden by an alpha blended canvasGroup?
Any help how to digg to the root cause is very appreciated. I have absolutley no clue where to begin digging.
I am looping through different character sets (english, korean, chinese) in a different labeltext causing this to happen.
IndexOutOfRangeException: Index was outside the bounds of the array.
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)
TMPro.TextMeshProUGUI.GenerateTextMesh () (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TMPro_UGUI_Private.cs:3905)
TMPro.TextMeshProUGUI.OnPreRenderCanvas () (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TMPro_UGUI_Private.cs:1654)
TMPro.TextMeshProUGUI.Rebuild (UnityEngine.UI.CanvasUpdate update) (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TextMeshProUGUI.cs:224)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/Program Files/UnityHubInstall/2019.4.1f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/CanvasUpdateRegistry.cs:210)
UnityEngine.Canvas:SendWillRenderCanvases()
It happens on this component, on character 7 which is a sprite.
TMP_Text.cs : Line 6816
// i = 7
// index_X4 = 0
protected virtual void FillSpriteVertexBuffers(int i, int index_X4)
{
int materialIndex = m_textInfo.characterInfo[i].materialReferenceIndex;
// materialIndex = 2
// but m_textInfo.meshInfo only has 2 entries => Index Out Of bounds Exception
// it is a sprite on a different atlas which is configured and works the most time. only oin this constelation it throws an error
// here should be a check if meshinfo has enough entries to get that, no need for an IndexOutOfBoundsException
index_X4 = m_textInfo.meshInfo[materialIndex].vertexCount;
}
I am having the same issue after I update to TMPro (1.5.3) using Unity 2018.4.28f1 (same on Unity 2018.4.30f1)
Downgrading to TMPro (1.5.1) solved the issue for me, but I would like to keep using the latest version without this issue
I just need someone to submit a bug report with project or whatever is needed for me to be able to reproduce the issue.
I am working on version 1.5.4 and equivalent release for other unity versions so if I can get this bug report, I can make sure the fix is included in there.
Hello @Stephan_B ,
Thank you, this change fixed the issue for us.
But we will keep using the older version until you ship an updated version on Package Manager.
just wanted to mention we’ve run into this issue as well. the fix on line 1616 seems to have worked for us, but obviously it’s not a great solution, as modifying a package is not something we can easily maintain or even chare properly via source control for our project. Is there an ETA on an update to TMPro in the package manager with this fix implemented? we are very near a submission date on our project.
I presume this release still hasn’t been completed, still showing 2.1.3 in Package Manager? I’m fighting this problem at the moment at a critical point in our release, it’s treacherous, as every time I close Unity and re-open it, the hack fix suggested above ([here]( https://discussions.unity.com/t/752139 page-2#post-6607135)) gets wiped out, making the release process quite risky. Any idea when a fix will be released?