CustomDepth issue

Hello everyone,

I’m trying to prevent 2 roads from overlapping. Also I use CustomDepth which displays pixels of a specific color (let’s call them X) if there is an overlap.
Then a function scans a TextureRenderTarget and returns true if at least one pixel X is present (in this case I prohibit the construction of a road).

The built road has a CustomDepth which is activated but not the previewed road nor the ZonesBlocks (constructible zones which are around the road), because I want to prohibit the superposition of two roads only

but I authorize anyone to build road over ZonesBlocks (others functions get rid of Overlapping ZonesBlocks intersection)

The problem is that if the camera is at ground level obviously the pixels X (because the road is just behind) are visible through the ZonesBlocks which is not only ugly but also prevent me from building other roads (don’t forget that pixels X are scanned on a TextureRendertarget).

Activating the CustomDepth of the ZonesBlocks solves the problem but obviously prevents me from building another road which overlaps the ZoneBlocks (which I don’t want)

Is there a solution to this problem please?