Two flat textures interfere with each other when both on z=0

Hi everyone, sorry if this has been posted before, I wasn't sure what to search for!

I have two flat game objects moving past each other both flat on the z-plane (z=0) but when they go past each other one texture is never in front of the other, they sort of merge and then snap from one texture to the other. Is there a way to fix this? I assume it's something with layers or tags?

Thanks!

That's known as z-fighting. A good fix is to use two different shaders, where one is a copy of the other but has `Offset -1, -1` in it somewhere. That way it's always drawn in front of the other object even when the surfaces are in the same plane.

Hi,

Eric5h5 suggestion is good. There is also another way out of this if you control the mesh themselves, by using having the center of each model apart. The one with the center closer to the camera will render first ( If I understand properly this thing...).

Also, if you plan on doing much work with flat textures in 3d, I suggest SM2 if you can afford it for your project, that will be a savvier and propose solutions for z fighting.

Bye,

Jean