Hello, I am developing a simple 2D Isometric Minecraft-like game.
Here is the problem I’m having. As on right now a block is selected when a mouse emitting a ray cast hits a collider of a block. each block has 3 colliders x(left) , y(right) , z (top)
when a block is partially occluded the face is disabled.
if a block is fully occluded (so all three faces covered) then the block is disabled.
here is the issue since this is a fully 2D game and we are simulating the effect of 3D each block has a world position AND a superficial position with a z to simulate depth we calculated rendering order based of position in the superficial grid system. The colliders how ever do not react to the rendering order since it does not affect them since they are physics based. So if you dig a hole into the side of some terrain and occlude the side of a block underneath another block the ray cast can still hit it through the block over top it
what we need is a way to prioritize certain blocks be hit over others. and if a collider is block by a collider “on top of it” to prioritize that one.