How to detect when an object goes past (so it looks like it touches) a UI element.

I have a UI element in the top right of my screen. When the player collects coins they shoot up in to the top right of the screen and past the UI element. I want to be able to detect when it goes past the element.

I considered adding a box collider top the UI element and using collision/trigger, the issue os that the canvas in engine is actually off screen the rendered over the camera so the box collider isnt actually where it looks like it is.

I also tried using if(object is at position), but because the positions go in to the .0000000’s, it was very rarely hitting it.

Personally I’d convert the coin’s position from World to Screen coordinates, then just check for proximity to your UI element, assuming the UI never moves of course…

A lot quicker and easier than try to do it through collisions.