Text Showing as solid blocks in Screen Space Camera mode

Hey,

I’m having an issue where my text (in Text Mesh Pro) is showing up as solid rectangles when I switch the camera from ScreenSpace - Overlay to ScreenSpace - Camera. The problem seems to mainly be happening when the plane distance is super low. I need the plane distance to be low however so that the UI elements always appear above the 3d objects in the scene (which sometimes come quite close to the camera).

I’ve been setting the plane distance to 0.03 (my near clipping plane on the camera is set to 0.01) which means that I can see all the elements, they’re still interactable, and the render in front of the 3d elements but this is what is happening to the text.

Is there a setting which can fix this for me?

This is how it looks in screen space - overlay:
5265987--526950--text okay.PNG

This is how it looks in screen space - camera:
5265987--526953--text not okay.PNG

Can you export a simple scene for me to look at? I am not able to reproduce the behavior on my end.

P.S. Make sure the scale of the text object is uniform (x, y, z) should all have the same values. You can also test the overlay version of the TMP shaders.

Did this issue get resolved in the end? I am having the exact same issue in Unity 2018.4.29f1 when using Text Mesh Pro. Any help would be appreciated.

Do you get this issue with a specific font asset or with all font assets?

Make sure the scale of the text object is uniform (X, Y, Z).

In the Debug Settings section of the Material inspector, make sure Scale X & Y is 1.

Are you doing any scaling of the text object? Like trying to animate it where you might be changing its scale? If so make sure we don’t end up with the scale being zero.

Can you post an image of the text object inspector so I can see the transform values, text component values along with material inspector with Debug Settings panel expanded.

P.S. What is the scale on your Canvas and Plane Distance on the Canvas?

The issue was originally caused by having too low of a plane distance value which results in extremely small scale value 0.0000x and therefore it can’t be represented properly in canvas:
7271284--878089--upload_2021-6-25_9-34-36.png
Are you also using small scale/plane distance/clipping plane values in your project? If so please follow @Stephan_B suggestions and try to use larger scale factor.

7271284--878074--upload_2021-6-25_9-28-24.png
7271284--878074--upload_2021-6-25_9-28-24.png

I’m also having this issue: the text (in TextMeshProUGUI) is showing up as solid rectangles when using a camera with “ScreenSpace - Camera”. If the Projection is set to ‘orthographic’, the texts render correctly.

On the left side is how they should appear while on the right side is what they look like when using a Perspective Camera:
9020992--1244314--upload_2023-5-18_11-37-15.png

I should mention that these squares with child TexMeshProUGUI components are prefabs that are spawned during play mode, and sometimes they spawn and show correctly, while the vast majority of the time they show as solid squares (right side).

Here’s what the camera looks like:

I tried manipulating the “Plane distance” on the Canvas (so that the scale is big enough) but to no avail:
9020992--1244296--upload_2023-5-18_11-30-40.jpeg

The text’s scale is also (1, 1, 1).

1 Like

Same problem here, in scene view the text shows up as solid white blocks