How can I decrease Mouse Sensitivity temporarily?

Hello,

I am using FOV to make a Sniper Zoom Effect, and In order to make the sniper actually work properly, I need to make the MouseDeltaSensitivity Lower… How can I make it revert to the original sensitivity the player had set after I stop zooming in?

Example

function: plr zooms in & mouse delta sensitivity = 0.5

after unequipping or pressing right click again, the mouse sensitivity should go back to normal, but how would I know the normal sensitivity or reset it?

Thanks.

local sensitivities = {}
playerAdded:Connect(f(plr))
    sensitivities[plr.Name] = datastoredsens:Get()
end)

and here we go you have defoult sensitivity stored in a table.

You need to use the user input service, here is some example code:

local UserInputService = game:GetService("UserInputService")
local origSens
function Aim(toAim)
    if toAim then
        origSens = UserInputService.MouseDeltaSensitivity
        UserInputService.MouseDeltaSensitivity = origSens / newFOV -- divide the origSens by whatever your new camera FOV is
    else
        UserInputService.MouseDeltaSensitivity = origSens
    end
end

Edit: Also, unless you have messed with the MouseDeltaSensitivity prior to this, default sensitivity is always 1 (MouseDeltaSens is not the same as camera sens)

7 Likes

Thank you,

I also found that by setting the local Origsens higher in the script, it will find and save the default sensitivity for all the below functions.