Character rotates itself counter clockwise everytime ShiftLock like conditions are simulated

So I have been working on a custom Camera System. I want to make a shift lock like system, kind of similar to evade third person. However, whenever these 2 conditions are simulataneously applicable, the character gets oriented a little bit counter clockwise.

RunService:BindToRenderStep("ShiftLock", Enum.RenderPriority.Camera.Value, function()
    Camera.CFrame *= CFrame.new(4, 0, 0)
end) 

UserGameSettings.RotationType = Enum.RotationType.CameraRelative

I have tried to undo the rotation by multiplying a CFrame.fromOrientation(some angle, 0, 0) but it just makes the camera look down, if CFrame.fromOrientation(0, some angle, 0) makes the camera rotate horizontally indefinitely. Using Humanoid.CameraOffset, or manually updating orientation to simulate shiftlock instead causes lot of jittering, i tried to make it so that instead it enables the default shift lock from PlayerModule/MouseLockController, but it only changes the mouse icon and nothing else.


I saw another forum post where someone encountered the same problem which they used an invisible part and set camera cframe equal to part cframe at every frame. tried that too, but that also causes lot of jitter.

#help-and-feedback:scripting-support