How to make a bezier more smooths

Hello fellow developers. I am currently making a soccer game and when the bezier of the ball finishes it sort of just stays floating for a bit and then goes down.
I am trying to make it go in the same trajectory it was going in even after the bezier is over.

The script

local function animateBall(Ball : Model, P0: Vector3, P1: Vector3, End: Vector3, Duration: number, Player : Player,HRP : Part)
	local Start = os.clock()
	local tD = task.wait()
	
	local Connection
	Connection = RunService.Heartbeat:Connect(function()
		local t = math.clamp((os.clock() - Start) / Duration, 0, 1)
		local newPos = quad(P0, P1, End, t)
		HRP.BallWeld.Enabled = false

		Ball.Ball.CFrame = CFrame.new(newPos) * CFrame.Angles(math.rad(.01) + Ball.Ball.Rotation.X, math.rad(.01) + Ball.Ball.Rotation.Y, math.rad(.01) + Ball.Ball.Rotation.Z)

		if os.clock() - Start >= Duration then
			Connection:Disconnect()
			if End ~= Goal.Goal.Position then
				Ball.Ball.Anchored = false
			end
			task.delay(1.5,function()
				Ball.Ball.Anchored = false
				Events.RemoteEvent:FireClient(Player,"StopSpectate")
				Ball:PivotTo(HRP.CFrame)
				HRP.BallWeld.Enabled = true
			end)
			return
		end
	end)
end

Video : GS _ DEV - Roblox Studio 2023-06-30 15-34-43

2 Likes

Could someone please help me? I need this fixed asap.

Around that part of the script, you should set the LinearVelocity of the ball in addition to unanchoring it. You could approximate the velocity as the difference of the last two points on the bézier curve.

I tried doing :ApplyImpulse but it still didnt work