Spline Mesh Component not following spline when larger values used

Hello UE gurus,

I stumbled across an issue that I can’t figure out, and wanted to see if someone here maybe has had a similar experience, or has a suggestion on how to fix it.

I’m trying to build a “ring” around a planet using a spline. The player can move around the planet and go into space, so it made sense to actually put a physical mesh there instead of some sort of backdrop. The spline and code for aligning the spline mesh work as expected at first glance. Here is a spline circle with a radius of 1,000.

The problem only occurs when you get to much bigger values for the spline size. Here is the same spline with a radius of 100,000,000.

As you can see, the spline actually looks fine and appears correct in the second image. It is the spline mesh tangents, however, that appear to get worse and worse as you increase the size, thus “detaching” the mesh from the spline.

Now, this might be a precision issue, but I don’t really see how, especially since the spline itself renders fine. Maybe there is some math within the Spline Mesh Component that doesn’t like big numbers? My tests show that separation starts at around a radius of 1,250,000. Not sure what to make of this.

Any help or suggestions are always appreciated :slight_smile:


Ok, so after some digging I found this piece of code here.

What’s odd about this is that I cannot think of a reason for this clamp. The StartTangent variable doesn’t have one. I removed the clamp and the spline mesh now behaves as expected. Maybe it’s an oversight?

At least there is now a solution, in case someone else runs across this issue :slight_smile:

Edit: Pull request https://github.com/EpicGames/UnrealEngine/pull/6909