here we go, i think i understood your problem, and in the attached patch there’s a possible solution.
I’ve used another approach instead stallone and multiflipflop. instead i’m using the objectid output pin of the hittest, and with an s+h i take the value when mouse is clicked.
then, if there are more slices selected, i simply take the last one with a cdr, because the last one is for shure the more in front.
of course this approach works in your case, because is 2s, so the layering is given by the position in the spread of the slices, but if you go 3d you need different approaches.
overlay_hierarchy2.v4p (23.2 kB)