I have a sphere and cube as such:
and I have the images of those 3D objects in 2D as such:
as you can see the z-index is incorrect (the sphere should be behind the cube). How can I find the 2D z-index based on the 3D positions of both objects? I considered setting the z-index to the global position.z, but it only accepts integer values. Perhaps something like to y sort
(“z sort”??) that arranges objects based on their z distances automatically?
Note:
I’m looking for a solution where moving one object doesn’t require effecting the properties of others
(e.g. if I move a 3D object I’ll have to change the z index of all other 2D objects)