I have had this issue with a number of TMPro versions. In my iOS build any TMPro text objects do not render their text unless: 1. I rotate my phone, after that point all TMPro objects render text correctly. 2. The TMPro text object is a child of a scrollview container object. If I have a sprite within my TMPro text object, the sprite will render automatically, but not any text that is in-line with it. Has anyone else had this issue or have any suggestions? I am using the most recent, free version of TMPro.
Edit: Solution from Stephan_B for those who don’t want to pick through below:
"The issue with the mixture of normal and UGUI text object comes from the Mesh Renderer and Canvas Renderer fighting over the ZTest on that material. They are both changing it to different settings which results in this behavior.
Solution is to have a set of Material Presets for normal text objects and one for the Canvas objects. So two sets total.
I have the same issue. Everything works fine in the Unity editor. In my IOS build every TMPro text render fine in the main menu until I start a new level. Then all text is gone! When returning to main menu this text is now also gone. It seems to happened with GUI text when change levels. 3d Text meshes works fine. I use the latest TMPro.
I still need a Repro project / bug report on this as I am unable to reproduce it on my end. If you do submit a bug report with repro project please provide the case # here.
The issue doesn’t seem easily reproducible and resolved itself after I discarded TextMesh Pro, tried to implement my own text solution, was unhappy with the results, and added back the TMPro text component. However, a few months later (this week) I ended up with the same problem again. On a random build, after making no changes to prefabs that use TMPro, some stopped rendering text. After a day of trial and error, removing all of TMPro and re-importing it, I found a solution (I hope).
Solution that works in my project:
Add a mask component to the game object that holds the TMPro component. The font material then gets a “Masking ID:1” and text renders properly on iOS builds.
Thanks! That could be the case, looking through my project I use a few normal , however, they are prefabs and when I’m having this issue they are not present in the scene. Does that make a difference? I’ll work through the linked thread and make sure I have things setup correctly.
The issue with the mixture of normal and UGUI text object comes from the Mesh Renderer and Canvas Renderer fighting over the ZTest on that material. They are both changing it to different settings which results in this behavior.
Solution is to have a set of Material Presets for normal text objects and one for the Canvas objects. So two sets total.
Thank you for your help! I think I have everything straightened out and working in my project now. I haven’t updated to unity 2018 yet so I’m not sure if changes have been made, but I would suggest TMPro assign separate Material Presets for UGUI and regular TMPro Text by default when dropping in a TMPro component from the menu. I appreciate how active you are in the forums. Very, very helpful!
Just popping in to say that I was having this same issue, and google search got me here to realize that I was mixing GUI and world-space text components with the same material preset. thanks for this thread!
Hello to all. Is this also the solution for text showing as boxes? I’m using Unity 2019.3.9 and just got converted the project from 2017.2.23(legacy textMeshPro). After the conversion, some texts rendered as boxes and with iOS devices, texts are not showing. I’ve tried creating 2 Material presets but it is still happening.
A potential source of the text disappearing is the result of using a combination of and text objects which shared the same font asset and material preset. See my previous posts above and links which explains why this can lead to issues and solution which is to simply use two different sets of material presets.
Thanks for replying Stephan, I read the posts above and also created two sets of material presets for the font asset(as you can see in the screenshot I attached). Also, we don’t use within our project but only . I changed also the objects with to which are being changed within the Update() thinking that this might be the cause, but still, boxes are appearing at some time in the devices.
You mean that you originally were using UI Text objects which you have replaced by objects but are still running into the same issue?
Text as pure white boxes might indicate the atlas texture is missing and replaced by white texture. If the boxes are grey’ish, then it is likely an SDF scale issue where the perhaps these text objects are being scaled.
Which of the two potential types of white boxes are you seeing?
Are you doing any type of scaling on the text object or its parents?
P.S. Which Shader are you using on those text objects? See if you get the same behavior with the Mobile distance field. There are also two new shaders included in the TMP Essential Resources of the latest TMP package which is Preview 10. These have SSD at the end of their name. There is a full version of the SSD and a mobile version. See if you get the same behavior with those?
Not all texts, but only that specific text object that was being updated with Update was changed from to but this was not the one having boxes but a different object, I decided to changed that thinking that it might be the cause of it.
I got both boxes(White/Gray) but not everytime, it also happened randomly and other case was text is not showing for iOS devices.
Yes we do scaling (by LeanTween) but for the parent holder not directly the Text object. I tried to changed the shader to Mobile distance field from Distance Field, but the problem still showing.
Preview 10 is still not showing in the Package Manager, is it gonna be available with Unity2019.3.9? or should I upgrade to Unity2019.3.10 to see the latest package?
Is re-creating the Font Asset might be a solution considering that the atlas texture is missing on rendering?
****** UPDATE ******
I tried to remove the scaling animation for the parent object and the texts rendered fine, but there should be another solution for this without removing of animation/scaling.
In order for the text to render correctly, the scale of the text object needs to be uniform. Ie. x, y, z of all the same value. Often when animating the scale, people leave Z at 0 which can cause issues.
Using a scale of zero can cause issues. I would have to look at the specific animation but most often these issues can be avoided by using a scale of 0.0001f. Ie. very close to zero but not zero.
Also, the shaders I referenced were new shaders with the label SSD as seen in the image below
The SSD shader doesn’t use SDF Scale and instead uses Screen Space Derivatives (SSD). I wanted you to test that one to rule out scaling related issues which we know it is now.
The problem has been fixed and yes, it was because of the scaling animation we have. Thank you Stephan_B for the fast replies especially giving the thought of having scaling might be the cause of it. I certainly didn’t thought that it will affect the rendering of the texts (which doesn’t happened in Legacy TextMeshPro). I’ll be keeping your recommendation of using 0.0001f instead of zeros.
Regarding the Distance Field SSD, It is not showing in my editor (Unity 2019.3.9f1) with TextMeshPro 2.0.1. I attached the screenshot of it.