Attaching ContentSizeFitter (even with unconstrained values) component to GameObject with TextMeshProUGUI component makes textInfo.characterInfo return wrong materialReferenceIndex:
Way to reproduce - fast:
- Download and Import attached unitypackage
- Open and Play Scene 23 - Animating Vertex Attributes
Way to reproduce - slow:
- Import TMP Essential Resources (Window → TextMeshPro → Import TMP Essential Resources)
2. Import TMP Examples & Extras (Window → TextMeshPro → Import TMP Examples & Extras)
3. Open Scene 23 - Animating Vertex Attributes
4. To see the problem more clearly: Remove VertexJitter component from TextMeshPro Text object
5. To see the problem more clearly: Change component VertexColorCycler code line 63
from*:*
c0 = new Color32((byte)Random.Range(0, 255), (byte)Random.Range(0, 255), (byte)Random.Range(0, 255), 255);
to*:*
c0 = new Color32((byte)Random.Range(0, 255), (byte)Random.Range(0, 255), (byte)Random.Range(0, 255), 0); - Duplicate TextMeshPro Text object. Change position of the copy so that they do not overlap each other on screen.
- Add ContentSizeFitter component to any one of TextMeshPro Text copies. You can leave params of this component as default (Unconstrained) values*.*
- Play scene. The order of disappearance of letters is different.
6015776–648464–TMP_ContentSizeFitter_bug.unitypackage (3.2 MB)