Absolutely — we should never override the player’s own mouse-sensitivity setting.
Roblox exposes the user’s chosen sensitivity through UserInputService.MouseDeltaSensitivity.
All we have to do is multiply our raw delta by that value instead of a hard-coded number.
Below is the minimal change to the previous script.
Only two lines are different:
We remove the local SENSITIVITY constant.
We replace the delta multiplier with UserInputService.MouseDeltaSensitivity.
Everything else (camera offset, vertical clamping, character facing camera direction, etc.) stays exactly the same.
lua
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = character:WaitForChild("HumanoidRootPart")
-- Settings
local CAMERA_OFFSET = Vector3.new(2, 1.5, 6) -- Right, Up, Back
local MAX_Y_ANGLE = math.rad(80)
local MIN_Y_ANGLE = math.rad(-80)
-- Internal
local cameraAngleX = 0
local cameraAngleY = 0
-- Disable default camera and controls
camera.CameraType = Enum.CameraType.Scriptable
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
-- Mouse movement (respects the player's own sensitivity)
UserInputService.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
local delta = input.Delta
-- Use the player's chosen sensitivity instead of a hard-coded value
local sens = UserInputService.MouseDeltaSensitivity
cameraAngleX -= delta.X * sens
cameraAngleY = math.clamp(cameraAngleY - delta.Y * sens, MIN_Y_ANGLE, MAX_Y_ANGLE)
end
end)
-- Update camera and character rotation
RunService.RenderStepped:Connect(function()
if not character or not rootPart then return end
local startCFrame = CFrame.new(rootPart.Position)
* CFrame.Angles(0, cameraAngleX, 0)
* CFrame.Angles(cameraAngleY, 0, 0)
local cameraCFrame = startCFrame:ToWorldSpace(CFrame.new(CAMERA_OFFSET))
local cameraFocus = startCFrame:ToWorldSpace(CFrame.new(CAMERA_OFFSET.X, CAMERA_OFFSET.Y, -10000))
camera.CFrame = CFrame.new(cameraCFrame.Position, cameraFocus.Position)
-- Character faces the same direction as the camera (shift-lock style)
local lookVector = Vector3.new(math.sin(cameraAngleX), 0, math.cos(cameraAngleX)).Unit
rootPart.CFrame = CFrame.new(rootPart.Position, rootPart.Position + lookVector)
end)
That’s it—players will now experience the camera exactly at the sensitivity they’ve set in the Roblox menu.