Hello. I want to tween a plane (let’s just use a part for now) flying really fast, but not really in a straight line, but sort of in a curve, like this:

this requires math, it shouldn’t be to complicated.

local startpos = Vector3.new(0,10,0)
local endpos= Vector3.new(10,10,0)
local distance = (startpos - endpos).Magnitude
local currentPos = Vector3.new(5,10,0) -- halfway
local DistanceY = 5 -- amount of studs the plane's gets to reach.
local half = distance/2
local Yposition = math.abs(currentPos.X/half) * DistanceY
local Position = Vector3.new(Xposition,0,0)

t - the progression in the bezier (0 start, 1 finish)
p0 - the start position
p1 - the mid position
p2 - the end position

local function Bezier(t, p0, p1, p2)
return (1 - t) ^ 2 * p0 + 2 * (1 - t) * t * p1 + t ^ 2 * p2
end
for Time = 0, 1, 0.005 do
Part.Position = Bezier(Time, StartVector3, TheMidPointVector, EndVector3)
task.wait()
end

or you can also use :SetPrimaryPartCFrame() if you’re trying to set a model’s position as long as you convert the bezier result to a cframe

and in order to be able to create a bezier tween you’ll use tweenservice:getvalue()

local TweenService = game:GetService("TweenService")
local function Bezier(t, p0, p1, p2)
return (1 - t) ^ 2 * p0 + 2 * (1 - t) * t * p1 + t ^ 2 * p2
end
for Time = 0, 1, 0.005 do
Part.Position = Bezier(TweenService:GetValue(Time, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), StartVector3, TheMidPointVector, EndVector3)
task.wait()
end

i didn’t test this so it might be too slow, or fast plus you’re able to change the easingstyle or direction if you want the movement to be any different