Script helping CFrame

local part = workspace:WaitForChild(“CameraPart”)
local CurrentCam = workspace.CurrentCamera
CurrentCam.CameraType = Enum.CameraType.Scriptable
CurrentCam.CameraSubject = part
local cam = 0
game:GetService(“RunService”).RenderStepped:Connect(function(x)
CurrentCam.CoordinateFrame = CFrame.new(part.Position) * CFrame.Angles(0, cam, 0)
for c = 1,100 do
cam = x * .1
wait(.3)
cam = x * .1
wait(.3)
end
end)

camera

My problem: the camera moves more smoothly to the right and left

Can you describe what you want to achieve? We know only the problem, we can’t help you without knowing what the script has to do.