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.
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.
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:
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.
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:
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).