UserGameSettings
The UserGameSettings is a singleton class found inside of the UserSettings singleton. It holds various persistent settings relating to how the user wants to control their camera, and their character.
You can access this object from a LocalScript via:
UserSettings():GetService("UserGameSettings")
This object is intended to be used on the client only, as it serves no purpose on the server. It will also reflect your own settings when testing in Roblox Studio.
Code Samples
A basic example that shows how you can listen to changes in the user's settings. With this code pasted into a LocalScript running in the StarterPlayerScripts, you can change settings in Roblox's game menu, and see their values appear in the output as detected changes.
local gameSettings = UserSettings().GameSettings
local function onGameSettingChanged(nameOfSetting)
-- Fetch the value of this setting through a pcall to make sure we can retrieve it.
-- Sometimes the event fires with properties that LocalScripts can't access.
local canGetSetting, setting = pcall(function()
return gameSettings[nameOfSetting]
end)
if canGetSetting then
print("Your " .. nameOfSetting .. " has changed to: " .. tostring(setting))
end
end
gameSettings.Changed:Connect(onGameSettingChanged)
Summary
Properties
The camera movement mode currently in-use by the client on desktop.
The type of controls being used by the client on desktop.
Toggles whether or not the client can use the Mouse Lock Switch mode.
Describes how sensitive the camera is when using a gamepad.
A float between 0 and 1 representing the volume of the game's client.
A float between 0 and 4 representing the sensitivity of the client's camera sensitivity.
Controls how the client's character is rotated.
The graphics quality level set by the client.
The camera type in-use by the client while on a mobile device.
The type of controls being used by the client on a mobile device.
Methods
Returns the camera's Y-invert value.
Checks if onboarding has been completed.
Returns true if the user's Roblox window is in full screen mode.
Returns true if the client's game session is in Roblox Studio.
If called, Roblox toggles the menu option to invert the user's camera y axis.
If called, Roblox toggles the menu option to control the camera sensitivity with gamepads.
Sets onboarding as completed.
Events
Fires if the user's full screen mode is changed.
Fired when the user's client switches between Studio mode and in-game mode. This gets fired periodically in Roblox Studio when a session starts.
Properties
AllTutorialsDisabled
CameraMode
ChatVisible
ComputerCameraMovementMode
ComputerMovementMode
Fullscreen
GamepadCameraSensitivity
GraphicsOptimizationMode
GraphicsQualityLevel
HasEverUsedVR
MasterVolume
MasterVolumeStudio
MaxQualityEnabled
MouseSensitivity
OnboardingsCompleted
PartyVoiceVolume
RCCProfilerRecordFrameRate
RCCProfilerRecordTimeFrame
RotationType
SavedQualityLevel
StartMaximized
StartScreenPosition
StartScreenSize
TouchCameraMovementMode
TouchMovementMode
UsedCoreGuiIsVisibleToggle
UsedCustomGuiIsVisibleToggle
UsedHideHudShortcut
VREnabled
VRRotationIntensity
VRSmoothRotationEnabled
VignetteEnabled
Methods
SetCameraYInvertVisible
Returns
SetGamepadCameraSensitivityVisible
Returns
Events
FullscreenChanged
Parameters
Code Samples
local gameSettings = UserSettings().GameSettings
local function checkFullScreenMode()
local inFullscreen = gameSettings:InFullScreen()
if inFullscreen then
print("Full Screen mode enabled!")
else
print("Full Screen mode disabled!")
end
end
checkFullScreenMode()
gameSettings.FullscreenChanged:Connect(checkFullScreenMode)