Reputation: 568
I want to check if a UI element is obscuring another UI element for example: when i click on the circled element [Screenshot 1] and the panel opens up [Screenshot 2] if the panel is displayed on top of the the circled element
same question about a UI element that is displayed on top of a gameobject element [Screenshot 3]
[Screenshot 1]
[Screenshot 2]
[
[Screenshot 3]
Upvotes: 0
Views: 358
Reputation: 132
You can use a raycast with the camera being the origin. This way, the first hit will be the one that is on top of everything, the second hit will be below that etc. You can traverse all the hits to determine what is on top of what.
Upvotes: 1