Spline Mesh Components: Tangent Snapping/Matching?

I’ve been setting up a system that allows the player to draw splines in real-time, and then connect separate spline meshes together. For example, the player may have to lay out sewage pipes in real time, and then connect separate sewage pipes together.

This has gone very well so far, but I’ve been struggling with trying to figure out how to snap the tangents of two separate spline mesh actors together seamlessly.

Does anyone know how I can do this?

Figured this out on my own- for anyone who may be wondering, in order to snap the end tangent of one spline mesh component to separate splines mesh’s start tangent, you must get the world transform of both spline meshes, and convert the second spline mesh’s transform to be relative of the first. Then you get the rotation x vector of the resulting transform, negate the y and z values of the resulting rotation x vector, and plug the final x,y,z values into your new end tangent coordinates. This also works in reverse when trying to snap a start to an end.

1 Like

Hi, would you be able to explain this a little bit more please?