I have a child ui element that is parented by a number of other UI elements, each with their own anchors / offsets etc. I want to find the absolute position of that particular child UI element in canvas space so that I can animate a effect to it ultimately. But I can’t find a function that easily obtains the absolute position rather than it’s rect being entirely relative to it’s parents. Does anyone have a good idea of how to achieve this?
Thanks for the response, It almost works for me, but the position seems to be slightly off (but not by a large degree), I wonder whether the canvas scaling being applied might affect this?
So yeah it turned out the canvas scalar was causing the issue.
The solution was to work out the logarithmic scale of the canvas scalar and apply it to the position returned from GetWorldCorners which allowed me to correctly find the location.
Is there any chance Unity can expose the UI logarithmic scale value from the canvasScalar rather than me having to try and calculate it manually?