How do I tween this bezier curve script?

I’m currently experimenting around with bezier curves, it’s quite complicated and I’m not really that great at math. Anyway, my goal with the script is to create a cool looking projectile where said projectile will do a curve trajectory towards it’s target. My problem is that once I test the game, it just stops at the curve part instead of doing a complete move towards the end part.

My question is how do I tween this script so I can see the process of it better?

	
	return (1-Time)^2*Point0+2*(1-Time)*Time*Point1+Time^2*Point2;
	
	
end

local supClone = game:GetService("ReplicatedStorage"):WaitForChild("Sup"):Clone()

local steps = .1

local StartPart = workspace.StartPart
local EndPart = workspace.EndPart
local CurvePart = workspace.CurvePart

for Time = 0 + steps, 1 - steps, steps do
	supClone.Anchored, supClone.CanCollide, supClone.Transparency = true, false, .5
	supClone.Position = QuadraticBezier(Time, StartPart.Position, CurvePart.Position, EndPart.Position)
	supClone.Parent = workspace
	
	
end
		```

Missing part at the top is

function QuadraticBezier(Time,Point0,Point1,Point2)

I recommend using lerp instead of Tween because tween is very expensive. (Also you aren’t yielding the loop so you won’t be able to see it move slowly)

1 Like

Oh, how would I yield the loop? I’m still kind of new to loops as well. They’re really not where I know the basics

wait(N) N is the duration you want to yield for.