How would I go about fixing this glitchy movement when I move my players camera around
RunService:BindToRenderStep("CameraMovement", Enum.RenderPriority.Camera.Value+1, function(deltatime)
local x, y, z = CurrentCam.CFrame:ToOrientation();
local camsLocation = HumanoidRootPart.CFrame * CFrame.new(HeightOffset + Character.Humanoid.CameraOffset)
local camsLocationsl = HumanoidRootPart.CFrame * CFrame.new(HeightOffsetSL + Character.Humanoid.CameraOffset)
local TookurPlace = TweenService:Create(CurrentCam, TweenInfo.new(0.3), {CFrame = camsLocation})
local characterMovement = TweenService:Create(HumanoidRootPart, TweenInfo.new(0.5), {CFrame = cMovement})
if camType == "Basic Camera" then
TookurPlace:Play()
CurrentCam.CameraType = Enum.CameraType.Scriptable
elseif camType == "Shift-Lock" then
TookurPlace:Cancel()
CurrentCam.CameraType = Enum.CameraType.Custom
CurrentCam.CFrame = HumanoidRootPart.CFrame * CFrame.new(HeightOffsetSL + Character.Humanoid.CameraOffset)
HumanoidRootPart.CFrame = HumanoidRootPart.CFrame:Lerp(CFrame.new(HumanoidRootPart.Position) * CFrame.Angles(0, y, 0), deltatime * 5 * 3)
end
if UserInputService:IsKeyDown(Enum.KeyCode.S) then
Character.Humanoid.AutoRotate = false
else
Character.Humanoid.AutoRotate = true
end
end)
It’s running on a BindToRenderStep. Any fixes or advice?