Problems with vertical loop on spline mesh

Monokkel
Thu, 02 Jun 2016 22:21:04 +0000
Audio

I am having some trouble making vertical loops for spline meshes. The basic problem is that spline meshes in Unreal Engine will twist 180 degrees if they are bent in a vertical loop. This is a problem that [has been solved before here][1], but I am having trouble implementing the solution I am unsure whether to attribute this to me not understanding it or if later updates have caused this solution to no longer work, and I hope someone in the community can help me find out what I’ve missed.

The other thread is a year old and marked as solved and I have not been able to contact the guy who solved it the last time, which is why I am opening a new thread. One difference between my blueprint and the one in the other thread is that I get the tangent at distance along spline instead of direction at distance along spline. Using distance no longer seems to work, but this might also be the reason why I am not seeing identical results to the other thread.

My setup for generating a spline mesh is very standard and work exellently for anything but vertical loops. Here is a screenshot of the construction script of the actor containing the spline and one showing the twisting that happens when entering a vertical loop:

Following the solution provided in the thread linked to above I have added a couple of extra node that rotates the up direction of each spline mesh so that it equals its normal, like so:

This works perfectly as long as all points are aligned along the same axis, but as soon as I move some of the spline points in the axis perpendicular to the main direction of the spline everything breaks down and all spline meshes are rotated incorrectly in relation to adjacent spline meshes.

I have been able to get the pieces to line up correctly by modifying the construction script so that I can manually change the start roll of each spline mesh segment, but is an inelegant and tedious solution for something it should be possible to automate.

Does anyone know what I might have missed in attempting to fix this problem? I am out of ideas on how to solve this so any help would be greatly appreciated.

20 posts - 10 participants