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.

코드 샘플

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)

요약

속성

메서드

이벤트

속성

AllTutorialsDisabled

병렬 읽기
Roblox 스크립트 보안
병렬 읽기
Roblox 스크립트 보안

ChatVisible

병렬 읽기
Roblox 스크립트 보안

ComputerCameraMovementMode

병렬 읽기

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

ComputerMovementMode

병렬 읽기

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

ControlMode

병렬 읽기

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

Fullscreen

병렬 읽기
Roblox 스크립트 보안

GamepadCameraSensitivity

병렬 읽기

Describes how sensitive the camera is when using a gamepad.

GraphicsOptimizationMode

병렬 읽기
Roblox 스크립트 보안

GraphicsQualityLevel

병렬 읽기
Roblox 스크립트 보안

HasEverUsedVR

병렬 읽기
Roblox 스크립트 보안

MasterVolume

병렬 읽기
Roblox 스크립트 보안

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

MasterVolumeStudio

병렬 읽기
Roblox 스크립트 보안

MaxQualityEnabled

병렬 읽기
Roblox 스크립트 보안

MouseSensitivity

병렬 읽기

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

OnboardingsCompleted

병렬 읽기
Roblox 스크립트 보안

PartyVoiceVolume

병렬 읽기
Roblox 스크립트 보안

RCCProfilerRecordFrameRate

병렬 읽기

RCCProfilerRecordTimeFrame

병렬 읽기

RotationType

병렬 읽기

Controls how the client's character is rotated.

SavedQualityLevel

병렬 읽기

The graphics quality level set by the client.

StartMaximized

복제되지 않음
스크립팅할 수 없음
병렬 읽기
Roblox 스크립트 보안

StartScreenPosition

복제되지 않음
스크립팅할 수 없음
병렬 읽기
Roblox 스크립트 보안

StartScreenSize

복제되지 않음
스크립팅할 수 없음
병렬 읽기
Roblox 스크립트 보안

TouchCameraMovementMode

병렬 읽기

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

TouchMovementMode

병렬 읽기

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

UsedCoreGuiIsVisibleToggle

병렬 읽기
Roblox 스크립트 보안

UsedCustomGuiIsVisibleToggle

병렬 읽기
Roblox 스크립트 보안

UsedHideHudShortcut

병렬 읽기
Roblox 스크립트 보안

VREnabled

병렬 읽기
Roblox 스크립트 보안

VRRotationIntensity

병렬 읽기
Roblox 스크립트 보안

VRSmoothRotationEnabled

병렬 읽기
Roblox 스크립트 보안

VignetteEnabled

병렬 읽기
Roblox 스크립트 보안

메서드

GetCameraYInvertValue

Returns the camera's Y-invert value.


반환

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:

매개 변수

onboardingId: string

The onboarding ID to inquire about.


반환

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.


반환

InStudioMode

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


반환

SetCameraYInvertVisible

void

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


반환

void

SetGamepadCameraSensitivityVisible

void

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


반환

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:

매개 변수

onboardingId: string

The onboarding ID to set as completed.


반환

void

이벤트

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.

매개 변수

isFullscreen: bool

코드 샘플

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.

매개 변수

isStudioMode: bool