Hi, i spent a bit making this camera script and it's all fine and dandy. But unlike the default roblox camera script mine experiences mouse acceleration, where giving the mouse a sharp turn can do a full 360, whereas in scenarios without acceleration this does not happen.

Here's the camera script:

run:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, function(deltaTime)
	local delta = uis:GetMouseDelta()
	
	XAngle += math.rad(-delta.X)
	--YAngle = math.clamp(YAngle + math.rad(-delta.Y), -1.9, 1.9)
	YAngle += math.rad(-delta.Y)
	
	uis.MouseBehavior = (shifting == false and Enum.MouseBehavior.LockCenter) or Enum.MouseBehavior.Default;
	
	cam.CFrame = cam.CFrame:Lerp(
		CFrame.new(character.PrimaryPart.Position) * CFrame.Angles(0, XAngle, 0) * CFrame.Angles(YAngle, 0, 0) * offset,
		deltaTime * 7
	)
end)

1 comment

0

Btw if the indenting is awful click 'View source' button