Spline - common loop problem
Hey guys. Got the same problem as some others around here when trying to loop with a spline.
I want to draw splines at runtime, that works nicely. But when looping, I get the rotation problem like others do.
In these threads it is always mentioned to adjust the Spline Up Dir, what somewhat seems to work on these guys. In my case, changing the Spline Up Dir does not seem to have any effect. It´s always the upwars loop that is causing the rotation problem, no matter what Up Dir is set on the spline. Spline Meshes are created on the go when the distance between two Points is to long. A new point is inserted and a Spline Mesh applied.
Here the spline point tangents are set, the spline updated and start and end of every spline mesh is set according to its spline points.
and this is what it looks with debug draw of spline point up vector, ugly rotation at loop still existing
My solution to that problem would be changing the roll of the spline mesh to counter the unwanted spline rotation. But the amount of roll to apply depends on the direction the spline is drawn and the tangent length of the points. Seems impossible to finger out when and what amount of roll to apply to a mesh.
A working example would be nice, there are enough that are in need of one. appreciate any help you can give.
Oook, found my problem with "SplineUpDir".
In order to make it work, you would need to set the "SplineUpDir" of an "SplineMeshComponent". NOT the "SplineUpVector" of the "Spline" as shone above.
Would be nice of Unreal would change this to "SplineMeshComponent"->"SplineMeshUpDir". Would make it more understandable.
answered Aug 17 '16 at 01:47 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here