TextMeshPro (and only TextMeshPro) UI elements are appearing behind gameobjects

I’ve been trying to add hud counters to a game made with 3d objects but all of the elements with TextMeshPro are appearing behind gameobjects. Normal text works fine as well as other elements such as images, but specifically TextMeshPro elements appear behind all objects in the scene. Is there a fix for this?

1 Answer

1

The GameObject the TextMeshPro component is on is probably in the incorrect place in the hierarchy.

If that doesn’t help:

Maybe you are using the incorrect TextMeshPro component?

Maybe it is displaying with an incorrect material?

Maybe the character atlas is not correct?

Maybe the sorting order or sorting layer is incorrect?

Maybe you should reimport TextMeshPro?

I believe this doesn’t apply to this case, but some extra information:

Renderers on GameObjects can appear invisible for multiple reasons. Here are some that come to mind:

  1. The Renderer is not enabled

  2. The GameObject is on a layer that is not visible to the relevant camera

  3. The GameObject’s tag is “EditorOnly” and you are in a build

  4. The GameObject is not active in the hierarchy

  5. The Renderer is fully transparent

  6. The Renderer is a CanvasRenderer and the Canvas is disabled

  7. The Renderer is being drawn behind another Renderer

  8. The Renderer is being drawn off-screen

  9. The Renderer is masked

  10. The Renderer’s shader is not fully supported on the device

  11. The Renderer is a SpriteRenderer and is not displaying a sprite

  12. The relevant camera has a lower priority than another camera, which has a viewport rectangle that fully covers the relevant camera

  13. The relevant camera is disabled

  14. The relevant camera is on a GameObject that is not active in the hierarchy