Here is a quick and dirty blueprint solution for a spherical trigger:
(EDIT: Actually it should work for any trigger shape as long as the sphere trace encompasses it.)
First we make sure that although multiple overlap events can fire per actor per frame, we work with each actor only once:
(Part of the node network to the right is omitted for brevity.)
Then we pick an arbitrary point which is definitely outside the detection sphere. That is our starting nearest detected point, used in comparisons later, to find the closest point on the actor at hand.
The next step is firing a very very short sphere trace. Zero length (actual sphere) doesn’t work so we make it 1 cm long which is spherical enough. This spherical trace now covers the trigger sphere and returns all hits inside.
Let’s go through the hit results in a “for each” loop. The loop body starts like this:
Two things to note here: First, since we started this whole process after an overlap event occurred, we can be sure that the current actor is (partially) inside the sphere so it will be initially overlapping with the sphere trace as well. When that happens then some hit result properties change their meaning. For example “Normal” then stores the depenetration vector, a direction from the center of the sphere pointing toward one of the nearby points on the current actor. I have no idea how those points are picked I just saw that they are close and they are many.
Which brings me to the second important note: Multiple hit results will be about the same actor, containing a different one of those “nearby” points. So if we want to be as precise as possible then we can not break from the foreach loop when we found our actor the first time: we will have to check all hits and pick the closest of the nearby points.
Since so far we only have a direction of such a point we do a line trace in that direction to see how far our actor actually is. We iterate through the trace hits:
If we found the actor in question then we see if the hit point is the new nearest or not. And in any case we break out from the loop since the rest of the hits are irrelevant. After that we carry on iterating through the sphere trace’s hit results and doing this same line trace every time the current actor shows up. When we are done we should have the closest of the available points.
This method is not very precise, especially when the actors involved are moving fast, but might be good enough until we get a more elegant native solution.