Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Attaching ContentSizeFitter breaks index of characterInfo

Discussion in 'UGUI & TextMesh Pro' started by zeronewletters, Jun 24, 2020.

  1. zeronewletters

    zeronewletters

    Joined:
    Sep 11, 2019
    Posts:
    3
    Attaching ContentSizeFitter (even with unconstrained values) component to GameObject with TextMeshProUGUI component makes textInfo.characterInfo return wrong materialReferenceIndex:



    Way to reproduce - fast:
    1. Download and Import attached unitypackage
    2. Open and Play Scene 23 - Animating Vertex Attributes

    Way to reproduce - slow:
    1. 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);​
    6. Duplicate TextMeshPro Text object. Change position of the copy so that they do not overlap each other on screen.
    7. Add ContentSizeFitter component to any one of TextMeshPro Text copies. You can leave params of this component as default (Unconstrained) values.
    8. Play scene. The order of disappearance of letters is different.
     

    Attached Files:

    Last edited: Jun 24, 2020
    Rokannon, Chrsteam and Brightori like this.
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What version of the TMP package are you using?

    I just tested with Preview 14 and everything appears to be working correctly. Let me know if you still get the issue with Preview 14?
     
  3. zeronewletters

    zeronewletters

    Joined:
    Sep 11, 2019
    Posts:
    3
    Can't see "Preview 14". It reproduces to all versions
     
  4. zeronewletters

    zeronewletters

    Joined:
    Sep 11, 2019
    Posts:
    3
    Ohhh, I see now. I have not used preview packages. In Preview 14 it reproduces when ContentSizeFitter placed on parent object: