How would I read the localplayer's current graphics level, and detect when it is changed?

I’m currently trying to read the local player’s graphics level, to determine whether a notice saying “You are not on the recommended graphics level. Levels 8 and up are recommended for the best experience.” should show or not in the main menu of my upcoming showcase.

I’ve tried using UserSettings(), which used to work. It has since been made plugin-only.

My question is, is there any way to read a player’s graphics level, and detect when they change it?

This is not only useful for letting the player know that they are not getting the best experience with low graphics in a showcase, but it can also be extremely useful for custom LOD systems that calculate distance based on the players graphics settings.

Sorry for the bad formatting, it’s 2 AM for me.

5 Likes

This is a helpful page

Documentation - Roblox Creator Hub

Hey You! I noticed a lot of people are clicking that link so here’s an example:

-- This code would set a render distance variable to (10 studs * qualityLevel) - so max would be 210 studs with a min of 80 studs, modify as needed
UserSettings().GameSettings.Changed:connect(function()
for i=8, 21 do 
	if tostring(UserSettings().GameSettings.SavedQualityLevel) == "Enum.SavedQualitySetting.QualityLevel".. tostring(i) then
		qualityLevel = i
		renderDistance = qualityLevel*10
	end
end
end)

Extra Info:
SavedQualityLevel should be helpful as well as GetPropertyChangedSignal for detecting when properties change. Just check if the quality level is not equal to what it used to be and you’ll have whether it has changed or not.

16 Likes

When was UserSettings() made plugin-only? I still use UserSettings() in my game to check the client’s current graphics level and only allow them to play if they use graphics 8 or higher (just bypasses start menu - they can turn it back down after but are less likely to).

Where are you performing your check from? What does your code look like?

I can give you a snippet of my code. It still works for me.

-- Input Connection
local InputConn

-- Listener
InputConn = UserInputService.InputBegan:Connect(function (InputObject, GameProcessedEvent)
	-- Check for Graphics Quality Level and KEYBOARD Input
	if GameSettings.SavedQualityLevel.Value >= 8 and InputObject.UserInputType == Enum.UserInputType.Keyboard and not GameProcessedEvent then
		-- Disconnect Event and Confirm Quality Level
		InputConn:Disconnect()
		Sounds:WaitForChild("Confirm"):Play()

GameSettings is a variable stored at the top of my script, along with other variables related to services or the like.

local GameSettings = UserSettings().GameSettings

All that is ran from a LocalScript.

17 Likes