The problem with your setup is that the Sample Curve node's output is based on the complete curve, which means the Factor or Length are accumulated to the total length of all curves, if you have multiple curves in your geometry.
For example, let's say your geometry holds two curves: the first has a length of 4 meters, the second a length of 6 meters. This means for the Spline Parameter node:
- The first curve has a length of 0 meters and a factor of 0 at its starting point and a length of 4 meters and a factor of 1 at its end point.
- The second curve has 0 meters and factor 0 at the start and 6 meters and factor 1 at the end.
If you now use a Sample Curve node this accumulates all curves to treat them as one curve which results in the following values:
- The overall curve has a length of 10 meters, with factor 0 at the start of the first curve and factor 1 at the end of the last curve.
- The first curve now starts at 0 meters and factor 0, ends on 4 meters and factor 0.4.
- The second curve starts at 4 meters with factor 0.4 and ends with 10 meters at factor 1.
This was just for explaining the problem. The solution is quite simple: instead of using the Sample Curve node you can use the Tangent node and plug it directly into the Align Euler to Vector node. What I only would recommend is to increase the Resolution Preview U value in the Curve Properties to get a smoother alignment. And maybe, sometimes if the curve is a little bit twisted, it helps setting Twist Method to Z-Up instead of the default Minimum. But this also depends on which axis you choose to align to etc.
