Hi all, I have a textmesh which displays perfectly in a scene (layer:default, shader:GUI/Text Shader) However if I move my camera around (either in game or in the editor) the text mesh disappears from some angles. Any idea what this could be and/or how to fix it?
AH ha, I found what was causing this. Behind the textmesh object was another object whose shader was Unlit/Transparent . When I changed the shader of the object that was behind the textmesh to Unlit/Transparent Cutout, it all worked fine.
Just FYI, the unlit/transparent object in game is a piece of paper (3d model) and the text mesh is a child of this, which sits just above it.
@grimmy 's answer is decent, but I wanted to add a couple other things to this.
Obviously, this thread is really old, but I still find issues even with the modern TextMeshPro.
1.) I have TextMeshPro objects sitting on a UI panel with a background color(and default background image). I found that having the colored background “filled” actually interferes with the TextMeshes. Unchecking “Fill Center” or otherwise reducing the central color-fill on the panel with radial fill slider, etc., makes the meshes pop back up. I assume the background sprite is getting rendered in front of the Text objects sitting in front of it from certain angles. This is all under the “Image” component attached to my UI panel. (Fill types like sliced, radial360, etc.)
2.) This is a fix to the above and also a separate thing that’s pretty useful for many more material-related issues. This should also fix the issue @grimmy mentions with the shaders. Though, this could screw with other things depending on your scene, so keep in mind that this probably affects anything using the same material. Simply turn on Debug mode in the little dropdown right next to the lock icon. With TextMeshPro objects and other objects that have materials to access, alter the “Custom Render Queue” down in the Material section. Default for transparent materials is 3000, iirc. Set to 3001 or higher so that they “pop” to the front.
Again, keep in mind that you are altering the overall material and that affects anything using it. I’ve found it useful for both TextMeshPro objects and making things like lava-material in a lava lamp pop out through the colored glass, etc.
Higher render Queue numbers get rendered in front of lower. I’m no expert, but I believe that’s the simplest explanation.