Hi, it doesn't work because XSplinePosition returns the position where the Default segment is placed, not the end of the spline.
Probably the last segment is placed at 0.85 or so.
Also, for real values comparison, i suggest to not use == 0. It may fail because the rounding error. Instead, < 0.001 is a better solution.