I’m trying to figure out why the project I’m working on starts getting random FPS lag spikes after playing for a while.
After around 1–2 hours of gameplay, the FPS suddenly drops in big spikes. This usually happens more often after the character dies a few times.
I checked with MicroProfiler, and every single time the spike is caused by: Script.SchedulerHostConfig.default newindex_TextStrokeTransparency
It seems to come from the CoreScript of the chat system.
Right now, I only have one MicroProfiler dump in HTML format. The main thing to look at is frame 18, where the TextStrokeTransparency shows up during the lag.
I went through my scripts to check for bad loops or objects not being cleaned up, but couldn’t find anything on my end. It always points back to the chat CoreScript.
Every spike is the same: it’s always related to TextStrokeTransparency.
At this point, I’m not sure if this is something I can fix on my side, or if it’s a Roblox issue that should be reported.
Agreed. My earlier patch was heavy-handed. Here’s a clean, safe fix that avoids _G, avoids poking CoreGui, and removes the TextStrokeTransparency hot-path entirely.
if script:GetAttribute("init") then return end
script:SetAttribute("init", true)
local TextChatService = game:GetService("TextChatService")
if TextChatService.ChatVersion ~= Enum.ChatVersion.TextChatService then return end
local function trySet(o, prop, v)
if o and o[prop] ~= nil then
local ok = pcall(function() o[prop] = v end)
return ok
end
end
local win = TextChatService:WaitForChild("ChatWindowConfiguration")
local bub = TextChatService:FindFirstChild("BubbleChatConfiguration")
-- turn off stroke; no CoreGui traversal
trySet(win, "TextStrokeTransparency", 1)
trySet(bub, "TextStrokeTransparency", 1)
First, write to a random _G index (I guess it’s a game wise debounce variable?)
Then, tries to use :GetService("CoreGui"), which isn’t a valid service, from what I’ve tested
Even if you do game.CoreGui, roblox doesn’t let you, and returns nil instead
Then tries iterating over every object inside of CoreGui to set the TextStrokeTransparency to 1 (including stuff unrelated to the chat)
Then tries to also iterate over elements in RobloxGui (still not accessible cuz inside of CoreGui), to set a limit of 600 visible labels, but those labels are… Random labels from random guis (like the backpack, AvatarContextMenu, VehicleHudFrame, …)