I want to fix my Character “Lagging” its’ rotation.
If I Lerp Camera CFrame(the main problem):
If I don’t Lerp but just set camera CFrame to CameraTargetCFrame:
You can see my character body glitching, like it’s rotation being overriden multiple times(but nothing should cause it)
The problem isn’t happening if I set camera CFrame instantly(instead of Lerping and using deltatime from Runservice.RenderStepped)
local TargetRotation = CFrame.lookAt(HumRP.Position, Vector3.new(TargetPosition.X, Y_Target, TargetPosition.Z))
HumRP.CFrame = TargetRotation
local X = HumRP.CFrame.RightVector * OFFSET_X
local Y = Vector3.new(0, OFFSET_Y, 0)
local Z = HumRP.CFrame.LookVector * OFFSET_Z
local CAMERA_OFFSET = X + Y + Z
local CameraTargetCFrame = CFrame.lookAt(HumRP.Position + CAMERA_OFFSET, TargetPosition)
Camera.CFrame = Camera.CFrame:Lerp(CameraTargetCFrame, math.clamp(dt * 22, 0, 1))
I only think here main of problem with code fasting also in math clamp because his value out 1 to one not multiple for dt, try deleted math clamp and just put dt for accelerate of rotation
By “code fasting” you mean it takes too long to complete function? If yes then no, because I tested it and nothing changed(I just deleted other code, but nothing changed)