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)
