Is there any way to FORCE the z-index on a UI element without messing with the hierarchy?
I have a small tree of elements like this:
A
a1
a2
B
b1
b2
C
c1
c2
I I need to make sure that elements a2, b2 and c2 are always on top of everything else (tooltips). Because this whole thing is dynamically placed (player cursor position), I need to keep the hierarchy intact.
It should be possible to override the default hierachy based order for some elements by creating a nested canvas and setting either sorting layer or order in layer for that nested canvas.
This way you can override the Sort Order. From testing, setting it >= main canvas Order in Layer will show A and its children above B and its children, instead of below following hiearchy order.
But behavior when indices are equal may be uncertain so Iād recommended setting Sort Order to at least main canvas Order in Layer + 1.