Align spline rotation to landscape

Hi!

I am creating a procedural rail using splines. The idea is: as soon as I place the blueprint on the level, the spline automatically snaps to the landscape and align itself correctly. :slight_smile:

As you can see on the pic, the rail are not rotation-aligned to the landscape.

So far it was easy to snap the spline locations to the landscape, but does anyone know how to align the point rotation too?

I mean, what are the maths to align the spline point to the ground?

Found out! Many thanks to a friend of mine (hi Pierre!) who helped me out!

In case anyone ever needs this, please find the code here :slight_smile: Align spline location and rotation to landscape posted by anonymous | blueprintUE | PasteBin For Unreal Engine

(note that I add +8 to the locations of my spline points, this is not required and you can remove it if needed)

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.