4.7p3 Changing Closed Loop on a spline doesn't cause its length to change

If you have a spline that is not a closed loop, get its length, call set close loop to true, and get its length again, it still returns the original length. Vice versa if it started closed, its length never gets shorter if you later change it to open.

To repro:

Create a new blueprint, say spline_test. Open it up and add two splines, first spline and second spline. Leave first spline as open loop and set second spline closed loop to true.

I made a debug function in this spline_test BP like this:

And a function to print out a spline, its current open/closed state, and its current length. Then flip the close loop flag on the spline for next time.

Finally a quick bit in the level map to debug this by pressing F key.


So now you can see when it starts up, s1 is an open spline and has length of 100. s2 is a close spline with a length of 200, twice as long as you would expect. Now hit F key. You see that s1 and s2 both alternate between open and closed loops as expected, however you will see that s1 always reports its length as 100 and s2 always as 200 no matter their open/closed states.


Hi Furroy,

Thank you for the report. I was able to reproduce this in the 4.7.0 Preview. I’m still investigating the cause but I plan to post back here with an update soon.

I’m unsure of a workaround for this issue. It seems that setting a spline to a closed or open loop isn’t reflected if it is done through blueprints. I have created UE JIRA-7792 in our tracking software and our developers will be investigating the issue further.



If anyone gets stuck on this, my own workaround is to create them always closed and my own get length function knows to optionally subtract the last segment for open loops. But if you guys can fix it in the engine that would be ideal. Ty.

Sounds good, thanks for posting your workaround.

Well I feel kind of silly after spending all day debugging another issue with splines, I should have guessed the root cause was related to the length bug. So I’m letting you know changing open/closed on a spline also does not update the spline point tangent of the last point as you would expect. It’s probably the same bug, but they’ll want to test for both cases.

Here I am expecting for the last tangent to change from <0, 0, 0> that it should be for a closed loop to <1, 0, 0> which is normal for an open loop. But it still reports <0, 0, 0> after opening the loop.

Hi Furroy,

I believe you are correct, this seems directly related to the open/close length issue. I will update the report so the devs will know.

Thanks again,


I have a fix for this which is currently in internal review and will be submitted soon. The problem is, as you suspected, that the Blueprint function to set the closed loop state wasn’t updating the spline afterwards.

I’ll report back here when there’s a changelist you can integrate. Meanwhile, if you want a rough and ready fix, you can add the following line into USplineComponent::SetClosedLoop:

void USplineComponent::SetClosedLoop(bool bInClosedLoop)
	if (bClosedLoop != bInClosedLoop)
		bClosedLoop = bInClosedLoop;

		if (bClosedLoop)

        UpdateSpline();   // <<<<< ADD THIS LINE

It’s not especially optimal, but there’ll be some spline component optimizations coming in the near future which should improve performance.


has this been fixed?

Thank you.

Hi ,

This was fixed in the 4.8 release. Are you seeing it in that build or 4.9?

Has this been fixed? Because in 4.11.2 if i use “Get Location at Distance along Spline” with the length i get from “Get Spline Length” i end up at the last Point of the Spline not the first as it should be with a closed Spline IMO. This is bad if you want to use a Spline as for example a Raceline or something like that.

Edit: It does not work if i set the Spline to be closed in the editor. Seems to work if i use “Set Closed Loop” in the construction script of the Actor containing the Spline.

Hi avision,

Thanks for the bug report - am I right to believe that this problem only shows up when trying to Get Spline Length in a Construction Script? There was a problem with the propagation of the bClosedLoop property, which is now fixed, and should be in the upcoming 4.13 release.

Many years later, but there’s still a related bug to this one even in 4.26.

If you adjust the “Closed Loop” option on the spline component of an actor in the world, then the change will not be visible in the construction script - it will continue to see the old length and the closed loop property in its old state.

However, if you change the option on the blueprint class that the actor is derived from, then that change will be propagated to the world object.

This is probably related to Unreal Engine Issues and Bug Tracker (UE-36728) - though the bug is larger than just that one property not being read.