- Home /
Unity UI Text with markup tags - “String too long for TextMeshGenerator”
I have a Text UI component in which I have 20 lines of 100 character long columns. This works fine. But if I try to enclose each character inside <color> </color>
tags to give them different colors, I get the following error messages:
String too long for TextMeshGenerator. Cutting off characters.
ArgumentException: Mesh can not have more than 65000 vertices
I don't understand why the tags count towards the character limit, or why they increase the number of vertices.
What would be the best way to solve this? I am using Unity version 5.4.1f1.
Comment
Split that text in couple UIText elements. Quick solution.
Thanks for the suggestion. I tried dividing it into four separate UIText elements, and got it working. However the UIText seemed to have a lot worse performance compared to GUIText components, so I'll be using them ins$$anonymous$$d.