Is it possible to change the mouse sensitivity only on the X axis?
I have tried countering the mouse movement by multiplying the mouse delta onto the cameras angle, but that was choppy looking
Is it possible to change the mouse sensitivity only on the X axis?
I have tried countering the mouse movement by multiplying the mouse delta onto the cameras angle, but that was choppy looking
-- Get the UserInputService and Camera
local UserInputService = game:GetService("UserInputService")
local Camera = workspace.CurrentCamera
-- Set the desired sensitivity for the X and Y axes
local sensitivityX = 0.5 -- Adjust this value to change the X-axis sensitivity
local sensitivityY = 1 -- Adjust this value to change the Y-axis sensitivity
-- Function to handle mouse movement
local function handleMouseMovement(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
-- Get the change in mouse position
local deltaX = input.Delta.X
local deltaY = input.Delta.Y
-- Adjust the mouse movement on the X and Y axes
deltaX = deltaX * sensitivityX
deltaY = deltaY * sensitivityY
-- Rotate the camera based on the adjusted mouse movement
Camera.CFrame = Camera.CFrame * CFrame.Angles(0, math.rad(deltaX), 0)
Camera.CFrame = Camera.CFrame * CFrame.Angles(math.rad(deltaY), 0, 0)
end
end
-- Connect the handleMouseMovement function to the MouseMove event
UserInputService.InputChanged:Connect(handleMouseMovement)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.