Can you tell me how to make such a spline dynamically? I can’t adjust control points. I don’t understand what to put in the input key point.
I made this spline by implementing a quadratic bezier function, but I need the length of the curve, but I can’t figure out how to use the spline component to implement the same curve
Sorry to hear you’re still having problems - I understand, those tangents can be a bit tricky to do by hand.
Try this:
Create a simple Blueprint with just a spline in it, go to the “Viewport” tab and switch to “Top” view mode.
Now drag the end spline point out a little to the right, now drag with Alt held down to clone that point and drag that out. Then drag the middle point up.
It should look something like this: (all points are selected to show the tangents)
Now when a point is selected, you can click on one of the end points of the tangent and start moving that around - moving the start/end tangents top point out a little creates more of a circular curve (your example is not as curved as this, just wanted to show the contrast)
Hello again!
Yes, I’m still having problems with splines, it’s been 3 days now. I just need to create splines in real time, so I can’t get it to set up. Everything is fine in the viewport, the problem seems to be real in that I cannot find such values in the code at which the spline would be displayed well. I tried your way of copying the spline values, but for some reason it didn’t work. Perhaps because the values of the control points in the viewport move together (arrive and leave tangents), and in the code I specify them separately (there are also some problems with this). But the main problem is that I can’t display the spline and its control points when I create it dynamically or i can?
Yes, in the Blueprint editor, just switch to the “Viewport” tab with your procedural spline - as long as your creating it in the ConstructionScript, you’ll see what it produces from there.
Oh my God! I sit for 3 days in and do not understand why my spline works so strangely. I searched the entire internet to find the answer. I’ve reread all the code. But the problem turned out to be that there are already two points in the new created spline! Thank you very much, I don’t know how much more time I would have spent on this, I even became angry with Unreal Engine, because they absolutely do not describe spline methods in documentation, only parameters.
I noticed one oddity with control points, I remember that if the control points are in a mirror position, then an smooth arc is formed. But it’s not. If you create a spline in the editor, then the control point has a position: the control point - point, and if in the code, then in order to make an smooth arc, they become non-mirror.