Find spline key location along specific axis

I looked into the source code but unfortunately the algorithm used to find the closest point on a spline to a location is beyond my mathematical skills. But I saw that they used an “inaccurate” algorithm, i.e. they try to get closer to the nearest point by iterating. So I would do the same as suggested by 42EspoiR, iterating over a certain amount of points with a predefined delta distance between them, but use FVector::PointPlaneDist instead.