In our game, suddenly all Text Mesh Pro UGUI components became transparent.
That happens in editor, android and iOS, but is way more common in iOS, principally in iPhone X.
During one time that happen in editor, was notice that the text is only transparent in game view, staying normal in scene. The component went back to normal if the font/material was replaced and nothing changes when a different scene is loaded.
That error happens more frequently when all the scenes are unloaded and the first scene is loaded again or when some very specific requests are made to the server.
We are using Unity 2017.4.1f1 and Textmesh pro 1.2.2 but that was also happening with Textmesh pro 1.0.56.0b3.
I had a similar issue some time ago, which resulted in some texts not being displayed depending on the aspect ratio of the device it was on.
The reason was because the RectTransform for the text object was smaller than the minimum font size on the TextMeshProUGUI component.
Fixing the size and auto text size adjustments solved the issue.
To quickly test if that’s what is causing the issue you can select Wrappping & Overflow to: Disabled / Overflow.
If you are using a mixture of normal TextMeshPro objects and TextMeshProUGUI objects which happen to share the same material preset, this can produce this behavior as the MeshRenderer and CanvasRenderer systems are fighting over the ZTest on these objects. If that is the case, the solution is to have a set of Material Presets for the normal text objects which are in worldspace and another set for the objects using the canvas system.
Let me know if you have a mixture of these objects in your scene?
Hello Stephan_B,
In fact we have a mixture of objects using TexmeshPro and TextMeshProUGUI. There are no in the same scene, but sometimes both scenes are loaded.
I will try to create different material for each type of text and return to you if that works.
Thanks in advance.
I can confirm having the same issue, UI texts were disappearing. And I have got mixture of TextMeshPro and TextMeshProUGUI components in my scene. And by creating different materials for each set, issue seems solved for now.
2018.3.8f1
I am still having trouble with this. @Stephan_B So you are saying that the TextMeshPro UGUI objects can all be the same material but the other Unity texts have to or can all have the same of or different materials?
And by making sure of the separation then the texts will show in the Unity game tab?
I have a lot of materials to choose from and am trying to make sure I understand what is going on here and if my thinking/efforts are in synch with your solution.
This post is a year after the previous and am wondering if I am on the correct track. I also updated TMP to 1.4.x
Text disappearing when using a mixture of and components where these text object happen to share the same material preset or default material is due to how the Canvas System and Mesh Renderer fight over the ZTest which makes one or the other objects disappear. The solution for that is to make sure you have a separate set of Material Presets for the components and one for the normal components.
Text disappearing when using UI Text is a new behavior that I have seen lately which is unrelated to TMP.
Thanks for responding.
I have Unity Text and MTP text disappearing. They were working fine the other day. Then the MTPs disappeared and then the Unity texts disappeared. I have flipped through different materials and the results are the same. But at this point I have not totally got the two text type isolated on two different materials. There are Unity canvas button texts that I need to change(I think). But like I stated, this just started to happen. I have everything on the game screen then I pulled in the OVR gazepointer then the canvas buttons. Then boom. The TMPs texts disappeared and now all texts.
This bug is apparently still around; I just experienced it in a scene in which I have a UI (Screen Space Overlay) and also some world-space text overlays with the main camera. I’d been using both TMP and TMPUGUI for a while, but I forgot to update the TMPs to the new font I was using; as soon as I did that, the UI text disappeared!
The effect is pretty strange; saving the scene would make the text reappear briefly, but as soon as I made any changes or tried to run the game, it would disappear again. Duplicating the materials and using different ones for the worldspace text, as per suggestions several posts up, solved the problem.
Maybe comment #12 is a different workaround, possibly this only affects screen-space canvases. Didn’t try.
It’s literally A/B testable, if I try to switch the TMPs back to the same material I use for TMP-UI, then the UI text disappears, and if I switch it to the duped material, the UI text reappears. Definitely not related to graphic settings or anything of that sort.
I had the same problem too after I updated to 1.4.1 in 2018.3.14f1 Unity. I found a workaround to avoid the bug if I don’t scale my textmeshpro object to zero.
I just logged in to say that I had the exact same problem today (I was animating my popup windows from scale 0 to 1)
and I believe it’s safe to consider as a bug of TextMesh Pro. It was really to pinpoint the exact issue until I saw this post. I hope it’s fixed soon.
In order for the text to render correctly, the scale of the text object must be uniform (X, Y, Z). This scale is used to compute the SDF Scale which is the relationship between the final scale of the text object and the scale of the glyphs in the atlas texture.
An incorrect SDF Scale will result in either fuzzy or overly sharp text or white blocks of text. It can result in non visible text but mostly the latter. It is frequent for users who animate the scale of the text object to potentially end up with an incorrect SDF Scale as the text component is unaware of such scale changes. TMP does check every frame if the scale of the text object has changed before the frame is rendered but it is possible for users to change the scale after this check.
Since animating / scaling of the text object can be implemented in many ways, it is beneficial for me to get reproduction cases to allow to see if an alternative / better implementation might be possible. So please submit bug reports with repro projects as this would be most useful.
In my project I did experience following: Screen Space Overlay canvases lost their text content but in World Space and Screen Space Camera canvases text showed correctly.
This happened when I used Resources.Load() to load a font asset and assigned it to TMP_Text’s font property by a scripts; after loading the font and a new scene everything that’s in Screen Space Overlay canvases randomly disappeared.
Workaround for the issue is to use Text Mesh Pro only Screen Space Camera and World Space canvases; for Overlays I used regular Text
There is no need to use UI Text as the likely cause of the behavior is using a mixture of and text object where these share the same material.
As per the following post above:
When you create a new font asset, it has a default material. As such, two text objects using this same font where one object is in screen space overlay and the other in world space would result in this behavior.
Again the solution is to use a different set of material presets for these two groups of object.
We do have separate materials for both Text Mesh Pro and TextMeshPro UGUI, this had no effect on the disappearing text.
Please note that the bug happens only on ios with Metal and fonts did disappear when new scene is loaded, so this might be related to pre-baked rendering states in Metal. (as overlay and screen space camera have different depth test rules?)
To be precise on the bug, text disappeared on overlay canvases, and were visible on world space canvases. When opening a view with screen space camera canvas, text did re-appear on overlay canvases as well.
In one of the scenes where we did not have Overlay canvases, corruption never happened even when there are mixture of Text Mesh Pro and Text Mesh Pro UGUI objects; that allowed me to trace the cause.
Nevertheless, the workaround that we only use Screen Space Camera and World Space canvases seems to do the trick for now.
Are you able to reproduce this behavior reliably? If so could you please submit a bug report with project / repro steps? It would be great if we could get our iOS folks take a look at this.