How can I make the movement not choppy?

Im using a vehicle seat to move around. Im not using wheels so im moving with CFrame. I want to know how I can make it smooth. Like when you move it like has a teleport feel to it and it feels bumpy. How can I improve it?

local seat = script.Parent
local chair = script.Parent.Parent.Chair

local speed = 10
local steerAng = 30

local function onChange(property)
if property == “Steer” then
if seat.Steer == 1 then
repeat wait()
chair.CFrame = chair.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(-5), 0)
until seat.Steer <= 0
elseif seat.Steer == -1 then
repeat wait()
chair.CFrame = chair.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(5), 0)
until seat.Steer >= 0
end
end
if property == “Throttle” then
if seat.Throttle == 1 then
repeat wait()
chair.CFrame = chair.CFrame + chair.CFrame.LookVector
until seat.Throttle <= 0
elseif seat.Throttle == -1 then
repeat wait()
chair.CFrame = chair.CFrame - chair.CFrame.LookVector
until seat.Throttle >= 0
end
end
end

seat.Changed:Connect(onChange)

1 Like

First off, you might want to format your script, like adding ```, here’s an example:
3b36f60658fa95c76f7ea31f842b56c0

Also moving with CFrame is bound to be choppy and if it isn’t choppy then it’s going to be laggy. I suggest switching to physics.

but what should I use instead of CFrame?

I think this might help.

1 Like

multiply by the delta change offset