Character glitches when moving backwards (Custom Shift Lock)

So basically I’m forcing the player into shift lock mode with a custom script and it works fine except when you walk backwards and a bit sideways. The character glitches out / stutters when you do so.

Video:

Code:

conn = game:GetService("RunService").RenderStepped:Connect(function()
				game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
				local x, y, z = Camera.CFrame:ToOrientation()
				local cf = CFrame.new(char.HumanoidRootPart.CFrame.Position) * CFrame.Angles(0,y,0)
				char:SetPrimaryPartCFrame(cf)
			end) 
1 Like

Fixed it by turning autorotate off, guess taht was the issue the entire time

2 Likes