- Home /
Problem with 3D objects rendering in front of closer objects.
So I have a problem where game objects that are closer to the camera, render behind objects which are further away. I am currently doing a card game, and in this game I decided to make the text on the cards into Text Meshes. This works fine as long as the text is decently close to the rest. The problem is though that as soon as the text isn't really far away the render process sometimes makes mistakes and renders the text behind the card:
This is how it looks when it looks correct!
Here I moved the camera slightly to the right and suddenly the text gets rendered beneath the card plane.
Is there any way to fix this?
When moving the camera, does it instantly switch from being drawn in front to being drawn behind, or does it flicker a little bit?
Great! In that case, would you $$anonymous$$d posting the solution as an answer and then accepting it? It'd really help out anyone in the future who has the same problem and runs across your question.
I already did that! Except I don't know how to accept it ^^
Answer by Mytts · Jun 12, 2015 at 05:05 AM
Actually, in the days it took for this question to get accepted I finally found the answer myself, it was a fault of the shader. I used: Legacy -> Transparent -> Diffuse I changed that to: Legacy -> Transparent -> Cutout -> Diffuse and that fixed the problem entirely.