UserGameSettings

Mostrar obsoleto
Não criável
Configurações do usuário

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.

Amostras de código

UserGameSettings Listener

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)

Resumo

Propriedades

Métodos

Eventos

Propriedades

AllTutorialsDisabled

Ler Parallel
Segurança do script Roblox
Ler Parallel
Segurança do script Roblox

ChatVisible

Ler Parallel
Segurança do script Roblox

ComputerCameraMovementMode

Ler Parallel

The camera movement mode currently in-use by the client on desktop.

ComputerMovementMode

Ler Parallel

The type of controls being used by the client on desktop.

ControlMode

Ler Parallel

Toggles whether or not the client can use the Mouse Lock Switch mode.

Fullscreen

Ler Parallel
Segurança do script Roblox

GamepadCameraSensitivity

Ler Parallel

Describes how sensitive the camera is when using a gamepad.

GraphicsOptimizationMode

Ler Parallel
Segurança do script Roblox

GraphicsQualityLevel

Ler Parallel
Segurança do script Roblox

HasEverUsedVR

Ler Parallel
Segurança do script Roblox

MasterVolume

Ler Parallel
Segurança do script Roblox

A float between 0 and 1 representing the volume of the game's client.

MasterVolumeStudio

Ler Parallel
Segurança do script Roblox

MaxQualityEnabled

Ler Parallel
Segurança do script Roblox

MouseSensitivity

Ler Parallel

A float between 0 and 4 representing the sensitivity of the client's camera sensitivity.

OnboardingsCompleted

Ler Parallel
Segurança do script Roblox

PartyVoiceVolume

Ler Parallel
Segurança do script Roblox

RCCProfilerRecordFrameRate

Ler Parallel

RCCProfilerRecordTimeFrame

Ler Parallel

RotationType

Ler Parallel

Controls how the client's character is rotated.

SavedQualityLevel

Ler Parallel

The graphics quality level set by the client.

StartMaximized

Não replicado
Não scriptável
Ler Parallel
Segurança do script Roblox

StartScreenPosition

Não replicado
Não scriptável
Ler Parallel
Segurança do script Roblox

StartScreenSize

Não replicado
Não scriptável
Ler Parallel
Segurança do script Roblox

TouchCameraMovementMode

Ler Parallel

The camera type in-use by the client while on a mobile device.

TouchMovementMode

Ler Parallel

The type of controls being used by the client on a mobile device.

UsedCoreGuiIsVisibleToggle

Ler Parallel
Segurança do script Roblox

UsedCustomGuiIsVisibleToggle

Ler Parallel
Segurança do script Roblox

UsedHideHudShortcut

Ler Parallel
Segurança do script Roblox

VREnabled

Ler Parallel
Segurança do script Roblox

VRRotationIntensity

Ler Parallel
Segurança do script Roblox

VRSmoothRotationEnabled

Ler Parallel
Segurança do script Roblox

VignetteEnabled

Ler Parallel
Segurança do script Roblox

Métodos

GetCameraYInvertValue

Returns the camera's Y-invert value.


Devolução

GetOnboardingCompleted

Checks whether or not the given onboarding has been completed yet, which is useful for avoiding showing the onboarding animation again.

If onboardingId is not one of the accepted IDs, an error is thrown.

The onboarding process is one-way. This means that, as a developer, you can force the onboarding process to completion but cannot reset it.

See also:

Parâmetros

onboardingId: string

The onboarding ID to inquire about.


Devolução

Whether or not the onboarding in particular has been completed yet.

InFullScreen

Returns true if the user's Roblox window is in full screen mode.


Devolução

InStudioMode

Returns true if the client's game session is in Roblox Studio.


Devolução

SetCameraYInvertVisible

void

If called, Roblox toggles the menu option to invert the user's camera y axis.


Devolução

void

SetGamepadCameraSensitivityVisible

void

If called, Roblox toggles the menu option to control the camera sensitivity with gamepads.


Devolução

void

SetOnboardingCompleted

void

Sets the given onboarding as completed, so it won't be shown again to the user the next time they play.

Currently, this function only accepts DynamicThumbstick, and it is used to persistently track whether or not the player has finished the tutorial for the Dynamic Thumbstick control scheme. If onboardingId is not one of the accepted IDs, an error is thrown.

The onboarding process is one-way. This means that, as a developer, you can force the onboarding process to completion but cannot reset it.

See also:

Parâmetros

onboardingId: string

The onboarding ID to set as completed.


Devolução

void

Eventos

FullscreenChanged

Fires if the user's full screen mode is changed. The event will only fire on desktop devices that can toggle full screen mode. The game will always be in full screen on mobile devices and consoles.

Parâmetros

isFullscreen: bool

Amostras de código

Full Screen Mode Detection

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)

StudioModeChanged

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.

Parâmetros

isStudioMode: bool