FreecamScript does not account for DeltaTime for mouse input

The studio freecam script does not account for DeltaTime when calculating the pan and FOV from the mouse input. This means that higher framerates cause the camera to move slower.


Changing the Input.Pan and Input.Fov functions to divide by DeltaTime times the base framerate should fix the issue.

function Input.Pan(dt)
	local kGamepad = Vector2.new(
		thumbstickCurve(gamepad.Thumbstick2.Y),
		thumbstickCurve(-gamepad.Thumbstick2.X)
	)*PAN_GAMEPAD_SPEED
-	local kMouse = (mouse.Delta)*PAN_MOUSE_SPEED
+	local kMouse = (mouse.Delta / (90 * dt))*PAN_MOUSE_SPEED
	mouse.Delta = Vector2.new()
	return kGamepad + kMouse
end

function Input.Fov(dt)
	local kGamepad = (gamepad.ButtonX - gamepad.ButtonY)*FOV_GAMEPAD_SPEED
-	local kMouse = (mouse.MouseWheel)*FOV_WHEEL_SPEED
+	local kMouse = (mouse.MouseWheel / (90 * dt))*FOV_WHEEL_SPEED
	mouse.MouseWheel = 0
	return kGamepad + kMouse
end
4 Likes

Thanks for the report! Just to confirm, we have a ticket filed in our internal database for this issue.