This has been driving me crazy. If 2 UI elements have the same parent, there’s no problem. Their anchorPositions can simply be compared directly with no translations. But if they have different parents, even though they are in the exact same spot on the screen, their anchorPosition coords are different. Is there an API I can use to normalize their coords so I can compare them to each other?
Use Unity - Scripting API: RectTransform.GetWorldCorners
And then compare the 4 world spaced positions? That’s just one way using a default function.
Or maybe this can help: