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:
… 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
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!
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.
(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)
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.
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
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…
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?
@ExoStranger did you ever get this to work? I see creating the spline component in the constructor prevents modifying it (even with the InputSplinePointsToConstructionScript flag = true).
@Steb000 you can’t change the Override Construction Script flag for spline components created through script, can you? Only the “InputSplinePointsToConstructionScript” can be modified, which doesn’t seem to help.
Note, this problem is for splines created through construction script, not for components that are manually added and modified through construction.
Short update if anyone else gets stuck. This works (dynamically create Spline components and allow you to update them in the editor) if they’re created in C++ during OnConstruction.
The only catch is you will need to manage removing them when necessary.
Otherwise they’ll either always be re-created, or it will keep adding components without removing the old ones.