Guess we’re stuck with using UIS (until they block that “offscreen” coordinates?)
It’s too often I find on ROBLOX I have to use silly hacks to accomplish simple things.
As a ROBLOX scripter, that’s one of my slogans.
Not sure if this has been asked before but what are the sizes for the drop down button for the main menu?
the topbar height is 36, not sure about the icon.
The hamburger icon is 32px by 25px
Found it here
Was this rolled back? Returned an error saying it wasn’t registered.
Are you doing it from a localscript in StarterPlayerScripts? They run really early, so you may need to wait a little in order to give the corescript enough time to set itself up. The corescript is what disables the topbar, so if it isn’t listening yet, disabling the topbar wouldn’t work.
Ahhh, that was the problem. My bad.
It’s a really obscure issue – it’d be nice if the error was more clear i.e. “CoreScript has not finished setting up” or something like that.
This makes me want to add a signal that fires when CoreScripts are finished setting up. Should be fairly straightforward.
How can I ensure that the CoreScript is ready before trying to disable the top bar?
pcall() until it works for now
How do I tell when it finally gets hidden?
Whenever the pcall() doesn’t fail?
while not pcall(function() game.StarterGui:SetCore("TopbarEnabled", false) end) do wait() end
Pcall returns true
repeat local success = pcall(function() game.StarterGui:SetCore("TopbarEnabled", false) end) until success
I finally got around to checking it out and I’m not sure it solves any real issues. It’s not that bad to call pcall repeatedly until it works. If I added a signal, it’d also need a way to check if it’s already happened in case your script runs late. There’s not really a pleasant way to write this… except maybe a yield function that only yields if it needs to…
The worst thing is when you teleport into a new subplace and your topbar flickers because you had to wait a frame before the corescript initialized. I’m convinced that we can easily fix this on the corescript side instead of the c side.
repeat until pcall(function() game.StarterGui:SetCore("TopbarEnabled", false) end)
Is this not valid and cleaner? Preference I suppose.
You probably want a yield in there.