>>537881713
So the concept basically, your pointer / cursor CAST a RAY forward when you click the left mouse button. The UI that got clicked will be the UI that got hit by that ray, when you click your mouse button. Hence, raycast

You can also do some sort order on the canvas, to sort which one is in front of which one