Calculating 2D distance from sphere center

I have an actor with a sphere collision component attached to it.
Each frame, the mouse cursor’s opacity is supposed to fade in/out, depending on how close to the center of this sphere the mouse actually is.
Raycasting/tracing occurs every frame as soon as the OnBeginCursorOver event is fired, and ends upon the OnEndCursorOver event.

All is good, and everything works, except for one minor design problem… Any impact point on the sphere has the same distance to it’s center. You know, being a sphere and all. This means what I really need to be doing is some sort of math which takes the current camera view into consideration, paired with some magic that calculates the impact point on the sphere as if it were a 2D circle instead of a 3D object.

How can this be done?

So get the exact impact points x and y while ignoring z and calculate the distance to the spheres center. Or instead of a sphere for doing the collision checks just do box collider and get the xy distance to the center. If its larger than what ever you wanted the radius to be then just ignore it, it will still work like a sphere in that case.

Perhaps I’m misunderstanding you, but ignoring one of the axes doesn’t solve the problem, since the object can be viewed from different angles in 3D world space. For example, what if the object is being viewed from above/below/left/right/front/back?
In some of these cases, wouldn’t ignoring the Z-axis actually throw off the calculation?

Okay so I’ve come a whole lot closer.
What I’m doing now is storing the mouse cursor’s location as an FVector2D, getting the center of mass of my sphere/box components, then using APlayerController::ProjectWorldLocationToScreen to make the center of the component a 2D screen location. I can now get the 2D distance between the mouse cursor location, and the center location of the component, all done in screen space.

But now the issue is determining the maximum value that the distance can be while moused over the component. If you are closer to the component, it is much larger on screen, allowing for greater maximum distances between the cursor and the component’s center… Whereas if you are really far away, the max distance eventually becomes so tiny that you can’t even see the transition of the cursor’s opacity go from transparent to fully opaque.

So now I need a way to calculate what this max distance value should be, based upon the actual (visual) size of the component in screen space.