Add spline component - length not changing in "get spline length"

Hi, I am having trouble getting my head around something.

The blueprint construction script below creates a spline component and then gets the length of the spline and displays it.
But when I change the length of the created spline in the viewport it seems stuck at 100 units no matter how long I make. If I use an existing spline that I create myself there is no problem, but I need to create the splines on the fly in the construction script.

Any help would be great, thanks.

Hi KellDG,

This is because splines can be created in either the Construction Script or edited directly in the Viewport, however they are handled separately and you must choose one because one will override the other.

So you are adding the spline component and printing the length, which is by default 100. Since the Construction Script is handled separately, when you edit the spline in the Viewport it is essentially a separate instance of the spline in the level. But the Construction Script is still printing the length of the instance that it contains.

You can see this a bit better if you drag in a new instance of the blueprint. The Construction Script has locked the spline (showing purple) so it can no long be edited in the Viewport.