TextMeshProUGUI disappears

Hi everyone,

I’m having trouble debugging this : one of my TextMeshProUGUI is disappearing whenever i click on a button above the portrait. I noticed the TMP is losing its material but i’m not changing anything to this object its just a static text and the GameObject is enabled along with the TMP component. Text is not empty in the editor of course. I’d appreciate a bit of help i find this very strange.

This is the original image :

7563466--935923--upload_2021-10-11_15-31-32.png

and when i click a button that happens :

7563466--935926--upload_2021-10-11_15-32-15.png

Thank you in advance !

One common way for TextMeshes to conk out like this is if you set their scale (or any parent of them) to zero.

If this is the case, here is the proper way to set scales:

NEVER use Vector2 because that makes the third term (Z) zero.

ALWAYS use Vector3, and make sure that the .z is either 1.0f, or else your non-zero scale.

Similarly never set scale to Vector3.zero, especially in a UI, because this will cause layout divide-by-zeros and damage all your hierarchy.

I was about to explain my problem more explicitly, but it seems to be resolved : the TMP object had the option Maskable ticked. I unchecked it and it works. But it’s a weird bug as it is inside the mask and thus should be drawn…

So you know in the future; please use the dedicated UI forums here and not the 2D forums for UI. The 2D team do not maintain the UI features which is a separate team.

My bad i’ll do that

Not a problem, we can a large amount of UI posts here each day, it’s a common mistake. Good luck with your project.