# Get Location at Distance Along Spline not working

Hello!

I believe the function Get Location at Distance Along Spline is not working as intended in the following example. I have a demonstration project available (won’t link it here, contains marketplace content).

The setup is fairly simple - I have a spline component, and I am generating a number of spline mesh components along it’s length.

Here’s where I feed the spline component it’s points:

Here’s where I sample the spline at regular intervals of distance to determine start / end points for the spline meshes (this is immediately afterwards, there are no intermediate steps):

Here’s the associated logging, showing the six points fed into the spline component, and the resulting coordinates sample from seven intervals down the spline:

``````Point 0 = X=2870.295 Y=-1172.069 Z=15.228
Point 1 = X=2797.386 Y=-669.826 Z=2.310
Point 2 = X=2715.237 Y=-174.039 Z=-7.220
Point 3 = X=2621.710 Y=321.307 Z=-11.465
Point 4 = X=2504.450 Y=813.800 Z=-2.354
Point 5 = X=2411.000 Y=1000.000 Z=30.000

Start: X=0.000 Y=0.000 Z=0.000 End: X=342.479 Y=-58.613 Z=0.190 (0.0 / 500.0)
Start: X=342.479 Y=-58.613 Z=0.190 End: X=801.533 Y=-261.754 Z=2.750 (500.0 / 1000.0)
Start: X=801.533 Y=-261.754 Z=2.750 End: X=1258.350 Y=-477.039 Z=5.637 (1000.0 / 1500.0)
Start: X=1258.350 Y=-477.039 Z=5.637 End: X=1715.350 Y=-695.159 Z=8.629 (1500.0 / 2000.0)
Start: X=1715.350 Y=-695.159 Z=8.629 End: X=2172.464 Y=-910.722 Z=11.621 (2000.0 / 2500.0)
Start: X=2172.464 Y=-910.722 Z=11.621 End: X=2633.588 Y=-1114.987 Z=14.471 (2500.0 / 3000.0)
``````

I have noticed that the first coordinate fed back to me for distance 0 is 0,0,0, when it should clearly be X=2870.295 Y=-1172.069 Z=15.228 - if I change the offending node to return local coordinates instead of world coordinates , it gives me the exact same result.

I believe that the node is returning me local coordinates in both cases, which is obviously incorrect.

Thanks,

Luke

Update:

A) This is still broken in 4.17.

B) It looks like these nodes completely ignore spline tangents; if you modify tangents the visual line drawn in the editor will update, but these nodes are not returning correct locations with regards to the new spline.

This problem is clearly visible in this image; the meshes tiled down this spline are not following it at all:

Digging deeper, it looks like this has been a problem for a long time and has affected quite a few people:

There are essentially two problems:
A) Getting world coordinates gives local coordinates, resulting in the erratic, unpredictable results people are reporting.
B) Modified tangents are not respected in these functions (though the visible spline drawn in editor is correct)

Possibly related:

Until this problem is resolved, it is not safe to use splines for quite a few applications

I HAVE FOUND THE PROBLEM!

Set Spline Point Type wipes the current tangent values on the spline component - even if the point type did not change. This is further compounded by the fact that if this function is called and the point type does not change, the visual representation of the spline in the editor does not get reset to match the wiped tangents.