I'm having some trouble with Bézier Curves (Paths)


This is my second time posting about this, the first one went unnoticed and I’ve had no solutions myself since.

I’ve recently been struggling to combine multiple Bézier Curves into one path.

The main problem is that when the parts are generated, they overlap a bit at the start/end of each segment. I’ve tried to get the remaining progress on the previous segment, and add it when starting to interpolate the next. However, the progress will always be different due to the varying distances across the nodes.

TL;DR I’m trying to smoothly and seamlessly divide a group of CFrames using Bézier Curves (Technically Bézier Paths since it’s a group of multiple curve segments connected to one)

What I’ve tried so far:

		CP = math.floor(CurrentLerp)
		local Current = Model[CP].CFrame
		local Next = Model[CP+1].CFrame
		local Distance = (Current.Position - Next.Position).Magnitude
		CurrentLerp += 1/Distance
		LerpProgress = CurrentLerp - CP

        --All I do in this area is determine the control positions(unnecessary/unrelated code)

		local InterpolatedP = CalcBezier(LerpProgress, Current.Position, ControlPos1.Position, ControlPos2.Position, Next.Position)
	until CurrentLerp >= #Model:GetChildren()-1

This code creates very noticable gaps between segments which I’m trying to avoid.

Thank you for reading, and sorry for reposting this.

1 Like

So youre trying to space out the points evenly and its causing it to be inaccurate?
Is that what your problem is?

1 Like

Yeah, there’s usually 2 or 3 points out of order where each guide node is. If you’re still confused I can show you a screenshot

This is what I mean by the out of order nodes at the start of each segment.