Cannot get camera sensitivty (keeps going nil)

Hello!

Today, I have been trying to get the camera sensitivity of a player, using this code here inside of a local script stored in startergui:

local game_settings = game:GetService("UserGameSettings")
wait()
print(game_settings.MouseSensitivity)

Whenever I use this code, it gives me a error in the output saying,

I haven’t found any solutions to why this is happening, so thats why I am in need of some guidance here.

I also haven’t fully learned about the game:GetService("UserGameSettings") service, so I apologize if thats why.

Thank you.

This seems to work:

print(UserSettings():GetService("UserGameSettings").MouseSensitivity)
1 Like
local game_settings = UserSettings():GetService("UserGameSettings")
local Sensitivty = math.round(game_settings.MouseSensitivity * 100) / 100 --You can remove this line, if you want to keep the bunch of decimals.
1 Like

This works very well. Just one question; what are some benefits of using the UserSettings() function, what does it also do rather than get the camera’s sensitivity?


I’m not good at explaing :man_shrugging:

I believe it also gets the rotation of the character, as like for shiftlock kind of stuff.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.