BodyGyro and BodyPosition changes speed

Hello! I am making a zipline for my FE2 fangame! And the zipline keeps changing speed the larger it is. I don’t know why because all the values are numbers.

The code where the player moves:

local bodyPos = Instance.new("BodyPosition", plr.Character.HumanoidRootPart)
bodyPos.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyPos.P = 5000
bodyPos.D = 50
	
local bodyGy = Instance.new("BodyGyro", plr.Character.HumanoidRootPart)
bodyGy.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
bodyGy.D = 50
bodyGy.P = 5000
	
humAnim:Play()
	
game.SoundService.ZiplineOn.Playing = true
game.SoundService.Zipline.Playing = true

local posPoints = {}
for i=1, #points do
	table.insert(posPoints, points[i].Position)
end
local inc = 0.007
for t = 0, 1 - inc, inc do
	local pos = Bezier.GetBezierPoint(t, unpack(posPoints))
	local nextPos = Bezier.GetBezierPoint(t + 0.07, unpack(posPoints))
	local this = CFrame.new(pos, nextPos) * CFrame.new(0, 0, -1)
	bodyPos.Position = this.Position - Vector3.new(0,2.55,0)
	bodyGy.CFrame = this - Vector3.new(0,2.55,0)
	part.CFrame = this
	game:GetService("RunService").RenderStepped:Wait()
end

Can anyone help?

Don’t use BodyGyros. Those are deprecated and cause problems. Please use newer counterparts to avoid such issues.

Can you please tell me any alternatives and how to use them in this script?

It’s really easy. Because you use BodyGyro it’s newer counterparts is AlignOrientation

It works pretty much the same. The only difference is that you don’t really have to parent it to an object for it to work. You just choose attachment, and that’s it.

I recommend you read the documentation since AlignOrientation has more features and is basically suppressive to BodyGyro.

By the way this is what I mean by “changing speed” if you were wondering.
Long zipline:
robloxapp-20230711-1914522.wmv (911.6 KB)
Short zipline:
robloxapp-20230711-1915043.wmv (1.1 MB)

The document is too confusing for me, may you use it in a script please?

This is mostly due to not taking the distance between the points into account.

I found a new script and decided to use that. Thank you for trying to help however!