Spline mesh and loops
No amount of spline point rotation will make a spline mesh rotate properly (upside down) in a loop. I am setting the spline mesh component's start and end tangent in its BP construction script.
It's a bit of a hack job, but I was able to get loops acting correctly with a bit of math.
From the Get World Direction at Distance Along Spline node, simply Rotate Vector Around Axis. In my case (building a road along a spline), I rotated -90 degrees along the Y axis, then set the resulting value as the Up Dir for the Spline Mesh before doing any other calculations. This ensures that the up vector for any spline mesh along this spline is basically its "normal".
Here's a picture of my sloppy blueprint code. The essentials are highlighted.
And here are a few pictures of the track in the editor. The red lines are debug draws of the up vectors for each spline mesh (with a length of 200).
Hope this helps!
answered Apr 13 '15 at 08:50 PM
I think you need to play with the 'SplineUpDir' parameter. This has to be a direction which the curve will never be parallel to, that the X axis of the mesh will be oriented towards.
answered Sep 16 '14 at 01:11 PM
I know this is an old post but my plugin is specifically designed to address this issue.
It offsets a second spline so that even when the spline is subdivided you won't get any twisting.
answered May 25 '18 at 07:53 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here