How to apply player's camera sensitivity from its settings to a custom made camera?

When you make a custom camera, you can make the camera rotate base on mouse’s delta multiplied by a constant, we then can make it multiplied by the player’s camera sensitivity getting it from the player’s settings.

But how much is the constant exactly? And is the formula truly this?

cameraRotation = cameraRotation + UserInputService:GetMouseDelta() * math.rad(UserInputService.MouseDeltaSensitivity) * UserGameSettings.MouseSensitivity

PS: UserGameSettings.MouseSensitivity can be 0 thus the formula I gave has to be false as the camera can still move even when the sensitivity is set to minimum by the player.

And this is only for the PC players, I will need to make it compatible for mobile and other type of devices.

3 Likes

You are probably looking for UserSettings().GameSettings.MouseSensitivity.

Whoops, I didn’t read the formula you gave. You would have to compare it, but why not just using different CameraTypes?

Because i want to remove the max 80 degrees look up and down, i’ve tried a few tutorials but all of them results in the player’s camera sensitivity changing.

Sorry for not clarifying earlier.

Hmm, there’s probably a graphical reason as to why Roblox wouldn’t allow such thing. To test if the formula is correct, you’d probably have to compare the degrees with the real Roblox camera and your camera.

Go into play solo, then copy the PlayerModule located in StarterPlayerScripts and then paste it back into there and edit that after leaving play solo. It’ll be much better than trying to reinvent the entire camera system just for one simple change (You’ll specifically want to edit the BaseCamera module inside of CameraModule).

It’s a technical thing caused by how CFrame.new calculated some things when the lookAt argument is provided which gets solved by switching to CFrame.lookAt for those function calls.

What you meant is reuse the original code and alter it to my likings? I heard that the camera settings is not in there BUT I myself have not checked it.

I’ll update you on what I found

I did not find anything related to the player’s camera sensitivity, It might be because I did not understand a few of the variables name, maybe you can take a look too?