Spline update during gameplay

Hello, I have a Spline with a attached mesh that is spawned in the construction script.
In the eventgraph i have a door that the spline is attached to, half of the splinepoints should be fixed but I cannot solve this…
I have try saving the locations on beginplay that i want to be static, and during the “open door” event, i set the saved locations to the specific spline points but they still follow along the the actor in the rotation…
I am updating the Start/End locations etc… but it just does not work, I got a print string on the end just to make sure it fires through the update and it does but nothing moves…

Does anyone have a tutorial or can explain to me how updating during runtime should be done?

Thanks!

1 Like

Still struggling :frowning:
Anyone working with splines that can help?

Are you using spline mesh components for this? Or just place static meshes at spline points? Or doing something else altogether?

If you move the spline points, you need to update the position of the spline mesh components. They do not follow automatically.

Or am I completely misunderstanding what you’re trying to do? :slight_smile:

Yes you are right. But I am updating it after I move splinepoints. Is there some debug for gameplay so that I can see the spline like in the editor?
My script works if I add a new splinecomponent but I cannot change the one already made…

You can. When you construct the spline and add the SplineMeshComponents (SMCs), also add them to an array.

Every time you want to update the spline points, update them as usual. And then loop through the SMCs array and update their position matching the spline points.

edit: example with a pic:

omg! Yes! That must be it, i saved the meshcomponent as 1 variable, not an array.
Thanks alot, will try this tonight

I can confirm that this was the issue, I need to save the splineMeshComponents in an array.
Thanks for the help @Everynone !