Roblox chat button is still visible when chat is disabled

When the default Roblox chat is disabled, the main chat UI is not visible, but the button in the top bar still appears:

The button should stay hidden when the chat is not enabled. This was the behavior up until this recently, sometime within the past few days.

This is the code I use to do this:

repeat until pcall(function()
	game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
end)

Example file:
SetCoreGuiEnabledExample.rbxl (54.8 KB)

For whatever reason, this does not happen every time. I can’t really discern what makes it happen only some of the time, but it seems to happen more reliably in game than in studio for me. If that example file doesn’t work in studio, try publishing it.

Example of where this is an issue: Ultimate Battlegrounds

17 Likes

This issue has been happening to me as well. I am surprised nobody has made a bump or a response in the past 10 days!

5 Likes

I am experiencing this issue too. Please fix as it disrupts the UI in my game.

2 Likes

I’m having the same issue in my game, one thing that seems to make it disappear is setting all coregui to not display a second time (when i press the play button) but that’s obviously not how it is supposed to behave

1 Like

Bump. This bug is still occurring. The chat button shouldn’t be visible if it’s disabled

2 Likes

Happening over here too! How’s this not fixed yet -_-

2 Likes

The way I fixed this problem was by copying everything in my project to a brand new project :frowning:

EDIT: but still seams to not always work in live games??? :confused:

I have tried dozens of things to resolve this issue, but it just continues to persist. I’ve gone as far as adding a yield which waits for the entire game to load + an extra buffer before setting the core and it makes no difference.

It’s seemingly random as to whether the SetCoreGuiEnabled() method is able to remove the core-chat toggle button. It has been a persistent issue for multiple months now.

There also tends to be a disparity between live servers and studio test servers…

Live server:

Test Server:

I have also encountered this potentially relevant “infinite yield” message on multiple occasions, yet only in live servers:

Please fix this bug :pray:

1 Like

Hello thank you for the bug report. We are investigating internally. We will post an update when the issue is resolved.

4 Likes

Thank you for the heads-up!

Even though I explicitly hide this button in the code yet still shows up in the client, makes it distracting to have a useless internal button sit there with notification icons that will never disappear in the case of my custom chat.

I’d also like to report that playtest no longer seems to hide this button?
It seemed to work just fine in my private bare-bones place that has nothing but the chat functionality about 2 weeks ago, but as soon as it was implemented in a much bigger place last week, this stopped working.

heres a temp fix:

local StarterGui = game:GetService("StarterGui")

for i = 1, 2 do
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
	task.wait(0.2)
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
	task.wait(0.2)
end

If anyone is still having issues the following snippet should solve your problem. Just place it in ReplicatedFirst.

--//===================== Services =====================-//-
local StarterGui = game:GetService("StarterGui")

--//===================== Utility =====================-//-
local GetCoreGuiEnabled = function(coreGuiType: Enum.CoreGuiType) : boolean
	return StarterGui:GetCoreGuiEnabled(coreGuiType)
end

local SetCoreGuiEnabled = function(coreGuiType: Enum.CoreGuiType, enabled: boolean): ()
	StarterGui:SetCoreGuiEnabled(coreGuiType, enabled)
end

local GetCore = function(paramaterName: string): any
	local s = false
	local v
	repeat s = pcall(function() v = StarterGui:GetCore(paramaterName) end) if not s then task.wait() end until s
	return v
end

local SetCore = function(paramaterName: string, value: any): ()
	local s = false
	repeat s = pcall(function() StarterGui:SetCore(paramaterName, value) end) if not s then task.wait() end until s
end

--//===================== CoreGuiChatConnections =====================-//-
local chatWindowVisibilityChangedBindable = Instance.new("BindableEvent")
local chatWindowVisibilityChanged = chatWindowVisibilityChangedBindable.Event
local chatWindowVisibilityBindable = Instance.new("BindableEvent")
local chatWindowVisibility = chatWindowVisibilityBindable.Event
local messagesChangedBindable = Instance.new("BindableEvent")
local messagesChanged = messagesChangedBindable.Event

local db = 2
local VisibilityChanged = function()
	local active = GetCore("ChatActive")
	local coreGuiEnabled = GetCoreGuiEnabled(Enum.CoreGuiType.Chat)
	local visible = active and coreGuiEnabled
	chatWindowVisibilityBindable:Fire(visible)
	if visible then messagesChangedBindable:Fire(-1) end
	if db < 2 then db += 1 return end
	db = 0
	SetCoreGuiEnabled(Enum.CoreGuiType.Chat, not coreGuiEnabled)
	SetCoreGuiEnabled(Enum.CoreGuiType.Chat, coreGuiEnabled)
end

chatWindowVisibilityChanged:Connect(VisibilityChanged)
SetCore("CoreGuiChatConnections", {["ChatWindow"] = {["ToggleVisibility"] = chatWindowVisibilityChangedBindable, ["SetVisible"] = chatWindowVisibilityChangedBindable, ["TopbarEnabledChanged"] = chatWindowVisibilityChangedBindable, ["CoreGuiEnabled"] = chatWindowVisibilityChangedBindable, ["VisibilityStateChanged"] = chatWindowVisibilityBindable, ["MessagesChanged"] = messagesChangedBindable}})
VisibilityChanged()
1 Like

Hi, just reaching out that I’ve rolled out a change that should help mitigate this. Let me know if you see this issue persisting and I can take another look. Thanks!


Previously there was a race condition that sometimes meant that despite calling SetCoreGuiEnabled as false for chat, the unibar would initialize the state as opened. We’ve since refactored this to no longer rely on the order of events to set the open/close state and things should work as expected now.
This means if you were using any workarounds to force the top bar button to be hidden, you should be able to remove them and replace it with something more idiomatic.