Health fails to appear after disabling and enabling Topbar

When I disable and then re-enable the Topbar, I notice that the player’s name, age restrictions and health bar are no longer visible. The chat, inventory and emotes icons are there, but anything that is usually seen in the right sight of the Topbar no longer appears.

The bug reproduces when the LocalScript is placed in StarterPack, StarterPlayerScripts, or ReplicatedFirst. When it is placed in StarterGui or StarterCharacterScripts, the Topbar appears with the health bar as normal.
The bug does not occur without a relatively large waiting time. Having wait() does not cause any issues, but wait(1) does.
Note that I tested this in a completely fresh place, baseplate and all.

local StarterGui = game:GetService("StarterGui")

StarterGui:SetCore("TopbarEnabled", false)
wait(1)
StarterGui:SetCore("TopbarEnabled", true)

I suggest just changing the transparency of the Topbar, as disabling it will disable everything that the Topbar consists of (Chat, Backpack, and so on).

You can change the transparency as desired by doing something along the lines:

game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui'):SetTopbarTransparency(0)

You’re able to locate more information on this at https://developer.roblox.com/en-us/api-reference/function/PlayerGui/SetTopbarTransparency

Thank you for the suggestion, but I am aware of the ability to change the transparency of the top bar. In fact, setting the Topbar transparency to 0 would only make the background of the Topbar visible. Not exactly related to what I talking about.

What are you wanting to specifically disable?

I am working on a custom loading screen, which is why I preferred to disable everything in the Topbar before the game finished loading.

Couldn’t you just re-enable it using:
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, true)

I would attempt something like this, and you could change the topbar transparency, as well.

Otherwise, I am, unfortunately, unsure of the matter. My apologies for the confusion.

Then once you wish to enable it, you can simply change false to true and set the Transparency value to whatever you wish.

I just realized I made this post in Scripting Support by accident when I meant to post it in Studio Bugs. This is my first topic post. Smh.

1 Like

Make sure to double check where you’re posting :wink:.

Please read How to post a Bug Report and reply to an existing bug report if it exists or create a new one.