FilteringEnabled and StarterGui #RobloxDev

One of the many “opportunities for improvement” about FilteringEnabled is that some things will appear to work in Studio but not on the client, which means you can’t trust what you see when you press play in Studio.

A big one is that anything you place in StarterGui replicates to the PlayerGui just fine in studio run mode, but not once you publish it and play it on the client.

So, I always have a script on my PlayerAdded that loops through the guis in StarterGui and replicates them to the player gui, if they’re not there already.

-- put this inside your PlayerAdded function
repeat wait() until player:FindFirstChild("PlayerGui")
for _, gui in pairs(game.StarterGui:GetChildren()) do
     if not player.PlayerGui:FindFirstChild(gui.Name) then
          local g = gui:Clone()
          g.Parent = player.PlayerGui
     end
end

To be honest I’ve pretty much stopped using StarterGui with my games at all (which are all FE). I usually put the guis into a folder in the workspace and then replicate them into the PlayerGui when needed.

One last thing on GUIs: in 99% of use cases I’ve come across you want to have StarterGui > ResetPlayerGuiOnSpawn unchecked. It’s checked by default, but  I usually want my guis to come back when a player respawns.

 

Leave a Reply

Your email address will not be published. Required fields are marked *