Spline not editable when set in Construction Script

If Spline Component points are set in Construction Script (or are altered e.g. by Set Tangent at Spline Point), spline becomes uneditable in editor and during gameplay. Point handles become pink (instead of white) and it’s impossible to change their position via Set Location at Spline Point.

Is this a bug or by design? Maybe is there some workaround, even if it would need to change something in C++?

In 4.9 if you add spline points in construction script then you can’t edit them in the editor. But set location at point does work in real time. I have a tank tread animation done like that and i ca move control points on every tick.

It’s a pity… Well, maybe some C++ folks would know how to change it via cpp…

That’s interesting, in my case it doesn’t work. I’ve tried plugging this:
58201-1.png

… Into Event Tick, Begin Play, and other places… Still, the point doesn’t change its location during gameplay. I have around 7 points in my spline (set in construction script) and I’ve tried changing location of spline nr 0, 1, 2, 3, 4… None of them changed their position. (However, it works when I disable Construction Script and add points manually in editor)

How exactly did you set them in construction script? Can you see your spline properly in actor’s vieport?

If you want to edit spline in editor then don’t interact with it in construction. Otherwise check answer hub, some had to switch to 4.9 to get spline working and he was able to edit constructed spline, it was just glitchy or weird how you can do that.

In my case I’ve edited an empty spline in editor. Manually wrote down its tangents and positions into arrays and then populated another spline from construction to have it as a default setup.

Just to be on the same page, I’m talking about non render spline component not mesh component.

Arrrgh, I get it, sometimes I’m really dumb :smiley:
I have a Spline component and Spline Mesh Components added along spline. Spline points was correctly changing their locations, but I didn’t updated Spline Mesh Component position by “Set Start and End” node - so they stood in the same place and I’ve thought that it’s not working.
So, remember kids, after moving spline points while using Spline Mesh Component, always update Spline Mesh Component properties! :slight_smile:

Thanks for help bro!

  • Slavq, the dumb IT Engineer

To allow editing of Splines created in c++ you need to do 2 things.

  1. In SplineComponent.h change the line

to…

  1. Once you have added the spline points in c++ you manually set the variable like

So how to do it on BP if it is on other blueprint

SplineBase (my BP which has has spline-and add mesh) in the construction script iterate over the points in the spline and add the SplineMesh to each one, and it work nicely.

So Im trying to update a spline at runtime, but from other blueprint (say the player) I search for all the actors of “SplineBase” then with the display name I search for one specific and return it that is “Get Spline Aguja” in the tick, so apparently with the debug blue print the value is updated, but I don’t see moving anythingg.

Thought here says that I need to also update the SplineMesh components, don’t know if I need to remove them first, or how to actually get them or update them.

I did follow this https://www.youtube.com/watch?v=7YUxM0NDWRY for create the SplineBase.

(if it serve for something I can add splineBase to the map, and add points in between and see how it updates the shape, the nodes inside [knots??] are white so yeah I can edit them on the map).

NOTE: fon’t take into account the unconnected parts, I just say, lets try with 0 index)

Can’t edit the spline in the Blueprint Viewport, only instanced-based. Why?

InputSplinePointsToConstructionScript.PNG

Add this thingy to your construction script after adding the spline points via the Add Splint Point functions. This will allow you to change them in the editor after the construction script has run.

3 Likes

Thank you so much, it took me half a year now to solve this because I couldn’t find the reason why the splines suddenly became uneditable. So far just duplicated them and had to redo every single one I wanted to change so huge pain. With this they finally stay editable, you’re an angel :slight_smile:

1 Like

Thank you for this node tip! It is essential.

1 Like

can you edit the spline in viewport after adding it with “add spline component” node? I already tried ticked the “Input Spline Points to Construction Script” but still unable to move it in the viewport…

Yes I was able to. Make sure you click and have a check in the checkbox on the node.

Hey I’m currently having the same problem. I have a blueprint and I wanna edit the spline in the viewport after I’ve added it through the construction script. The problem being that even after using the “Input Spline Points to Construction script” node and setting it to true, it doesn’t let me?

The color changes from pink to white so I know I can edit the points but moving them in the viewport doesn’t change anything, because I think it’s being updated back to it’s default position instantly every time the spline moves? Any way I can go around this?