Search Unity

TextMesh Pro TextMeshPro text doesn't show up in built game

Discussion in 'UGUI & TextMesh Pro' started by HewwoCraziness, Jun 27, 2018.

  1. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    Once. About 8 weeks ago. And as I say bug persist even after Unity Version Upgrade

    UI Envoronment
    upload_2019-9-4_15-49-0.png

    Small Prefab
    upload_2019-9-4_15-52-17.png

    There is no another scales in hierarchy canvas is the only one.

    Tried to add ForceMeshUpdate() into context menu of perk item. Nothing changed.
     
  2. SmorcIRL

    SmorcIRL

    Joined:
    Aug 19, 2018
    Posts:
    2
    I had a similar error, the text did not clear in the build. The problem was solved in a very strange way: I just copied the TMP UGUI component values, reset it and paste the values back. After that everything worked fine. I hope this helps someone
     
  3. CDGKen

    CDGKen

    Joined:
    Jun 28, 2019
    Posts:
    30
    I've run into the same issue but managed to find a fix, but only in certain scenarios, which is super baffling. (NOTE: I haven't tried re-pasting all the component values as mentioned above because we use a ton of TMP objects and it would be impossible to find them all).

    Our code generates TMP objects at run-time and I figured I may have accidentally swapped between using UGUI and World TMP objects as suggested by Stephan earlier in the thread. So to be absolutely sure, now whenever I generate a TMP object via code, I do an extra check to determine (check for MeshRenderer or check for RectTransform or whatever) if I should make a TMP obj that uses Mesh or Canvas. That seemed to fix things, but only when the build is run under Fantastic or Beautiful quality settings. Anything less than that and it goes back to invisible text. That's not an issue for me since I plan to lock the quality settings when we build for final, but it's weird behaviour that I figured I'd bring up.

    I'm using 2019.1.9 with TMP 2.0.1 btw.
    (I should also mention the different quality settings are the default ones in Unity)
     
    Last edited: Sep 10, 2019
  4. multimediamark

    multimediamark

    Joined:
    Mar 17, 2017
    Posts:
    30
    I was struggling with same problem half day. For now it seems I fixed problem. Regenerated font asset with exactly same settings. Assigned new font asset to text fields. It is interesting that font asset has different weight. New one is lighter. It could be that something wrong is happening, when you regenerate font asset and overwrite it when it is already used in the scene. Hope it will fix this problem from now on and will for somebody.

    2019.2.8f1 / 2.0.1
     
  5. vishalmetadesign

    vishalmetadesign

    Joined:
    Nov 8, 2019
    Posts:
    1
    canvas or panel that contains your tmp text should not have value 0 for any of the x ,y or z scale values in the transform property. increase it to be 0.1 or something.
     
  6. Kechy

    Kechy

    Joined:
    May 21, 2020
    Posts:
    2
    Hello! Sorry for waking up this question, but I'm having weird problems with Text Mesh Pro, when I load my scene, it keeps throwing this error:

    ArgumentException: An item with the same key has already been added. Key: 68719476788
    System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <437ba245d8404784b9fbab9b439ac908>:0)
    TMPro.TMP_FontAsset.InitializeDictionaryLookupTables () (at Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_FontAsset.cs:589)
    TMPro.TMP_FontAsset.ReadFontAssetDefinition () (at Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_FontAsset.cs:607)
    TMPro.TMP_FontAsset.get_characterLookupTable () (at Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_FontAsset.cs:139)
    TMPro.TextMeshProUGUI.LoadFontAsset () (at Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMPro_UGUI_Private.cs:539)
    TMPro.TextMeshProUGUI.OnValidate () (at Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMPro_UGUI_Private.cs:302)

    .. and the text doesn't load sometimes in the editor, in build, it's always not loaded. Although, in the scene, if I reload the scene, the text will show up again. This is the first project where I encountered a problem with TMP, the only difference between other projects is the Unity Version I am using. On the current project where the issue is encountered, I am using Unity 2019.3.0f6 with the newest updated Text Mesh Pro from Package Manager.

    Some of the fixes I tried were reimporting text mesh pro, deleting and recreating all of the fonts used, checking through code, deleting texts and adding them to scene again, and resetting their transform values. After all of this, hopeless, I had to turn to this forum.

    Any help would be much appreciated, thank you!
     
  7. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Please consider updating to the latest release which is version 2.1.3 where this issue should be resolved.
     
  8. McPeppergames

    McPeppergames

    Joined:
    Feb 15, 2019
    Posts:
    103
    My problem is the TextMeshPro/Mobile material fails to compile on a PC under Windows. Runs fine on Mac but not on PC.

    Is there a way to fix this? I already have the newest TextMeshPro version.

    Update:

    I got the error:
    Shader error in "TextMeshPro/Mobile/Distance Field": Couldn't open include file "TMPro_Properties.cginc.at line 91
     
  9. vanBrusselGames

    vanBrusselGames

    Joined:
    Oct 1, 2020
    Posts:
    2
    I have some problems with Roboto Bold - Surface in build. Only with that material it won't display in Android build on buttons. In editor it displays as it should.
    I use latest release (3.0.6)
     
    Last edited: Aug 19, 2021
  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Does the issue also occur in a Desktop build or just on Android?

    If you create a new text object and use the same font asset and material preset, does it display?
     
  11. qinyupeng

    qinyupeng

    Joined:
    Apr 24, 2021
    Posts:
    11
    thanks, you saved my life
     
  12. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Hello,

    I created a Material preset of Electronic Highway Sign SDF

    Empty blank scene add a UI Tmpro text
    Game view (before running scene) ->
    upload_2021-12-29_14-43-55.png
    Game view after running scene ->
    upload_2021-12-29_14-45-17.png

    The shadows are no longer the same, you cant see the 'squares' and the color is different, what is driving this?

    How can it be fixed,

    Unity 2020.3.25f1
    Tmpro: 3.2 pre2 (and 3.0.6) same thing

    Note, the reason I tested in a new scene because this is what happens in my UI scene...
    Game view before running:
    upload_2021-12-29_14-50-6.png
    Game view after running with maximize on play:
    upload_2021-12-29_14-50-32.png

    Thank you
     
  13. xXSUPDOGXx

    xXSUPDOGXx

    Joined:
    Apr 6, 2019
    Posts:
    1
    When I switched the canvas render mode to world space, it fixed my issue.
     
  14. cgrow67

    cgrow67

    Joined:
    May 31, 2016
    Posts:
    52
    Its hard to imagine this problem is still around. We are seeing that built code will randomly have TMP text come up blank. We have an enormous amount of TMP code. We do use a custom font so I'm not sure if this is an issue. Are there any tools that will search for non UGUI controls? I do not believe a world space camera is going to work for our application. I am not sure how to approach this?
     
  15. cgrow67

    cgrow67

    Joined:
    May 31, 2016
    Posts:
    52
    After some experimenting it seems to happen when the game window is resized or resolution changes.

    We did recently update to URP and I have regenerated the Font Assets - SDF files.

    Thank for any help.
     
  16. Dante20011

    Dante20011

    Joined:
    Mar 3, 2015
    Posts:
    34
    I'm having this issue on Steam deck, using version 3.0.6 on unity 2021.1.23f1
    Unfortunately I don't have a Steam deck so I can't reproduce it, but it happens on all Steam decks so far. Do you have any tip?
     
  17. notunusual

    notunusual

    Joined:
    Jun 13, 2016
    Posts:
    12
    We've recently run into this issue as well, and it was indeed a case of us using shared materials between a TextMeshProUI and TextMeshPro object.

    Is there anything we can do to detect/stop this from happening? It's very non obvious and hard to protect against...
     
  18. Koder123456

    Koder123456

    Joined:
    Dec 12, 2021
    Posts:
    1
    Hi
    I am facing with the same issue. I have tried almost everything. I use TMPro version 3.0.6.
    I also checked every response on this thread and other threads on the forum. Deleting TMPro folder didn't work
    for me. In the Unity Editor it works fine but in build my UI text is not showing at all.
    I send a screnshot of my game.
    Hope you can help.
     
    DavidZobrist, chenry22 and newguy123 like this.
  19. DavidZobrist

    DavidZobrist

    Joined:
    Sep 3, 2017
    Posts:
    233
    For us it works fine for local builds. But using the unity cloud build all text mesh pro text is gone in the build.
     
  20. doganakdag

    doganakdag

    Joined:
    Oct 25, 2019
    Posts:
    14
    We are having this problem with Unity UI Text component, TextMeshPro components are working fine. Also, everything works fine on local builds, but our custom font which is used in Unity UI Text component can't be seen in any ios cloud build
     
  21. DavidZobrist

    DavidZobrist

    Joined:
    Sep 3, 2017
    Posts:
    233
    It was our own mistake, we had updated TextMeshPro at some point and the location in the project changed.
    We .git ignored the new location by mistake.
    So the textmesh pro components were not on git.
    So the cloud build could not find it.
     
  22. MadaleGamesCEO

    MadaleGamesCEO

    Joined:
    Nov 24, 2023
    Posts:
    4
    i get an error saying that camera doesnt contain a definition of current and cannot convert from Camera to UnityEngjne.Camera
     
  23. RASHED1237

    RASHED1237

    Joined:
    Nov 26, 2023
    Posts:
    2
    hi Unity Technologies, i have an issue related to text mesh bro when im trying to write in arabic word its shows like this :https://ibb.co/zQ5Ly7r , i add <application android:supportsRtl="true"> in android manifest but its still not show and i tried using only text the arabic shows in unity and pc but its didnt show at all in android after build can you help me? and thanks!