Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug [3.2.0-pre.1]Text as squares in rare case

Discussion in 'UGUI & TextMesh Pro' started by Kamyker, Sep 2, 2021.

  1. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,084
    This is rather low priority as I found workaround but here it is:

    If on the same frame I do:
    Code (CSharp):
    1. tmp.text = "text";
    2. tmp.gameObject.localScale = Vector3.zero;
    Text will be renderer as squares even after increasing localScale. This is common usage to make popping text animation. In my case I had it on "3D Object/Text TextMeshPro", haven't tried UI. Going to make repro later, workaround:
    Code (CSharp):
    1. tmp.text = "text";
    2. tmp.gameObject.localScale = Vector3.one * 0.0001f;
    Btw I downloaded new tmp essentials.
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    I was able to reproduce this issue and have resolved it.

    The fix will be included in the next preview release of the TMP package. In the meantime, the workaround that you have should work fine.

    P.S. The following change in both the TMPro_Private.cs and TMPro_UGUI_Private.cs will resolve the issue.

    upload_2021-9-1_22-52-5.png
    In order for the above change to be persistent, it will need to be made in the Global Package Cache of the package.
     
  3. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,084
    Thank you, that was quick!
     
    Stephan_B likes this.