Reproduction Steps
This can be reproduced by immediately renaming the PlayerGui when the player joins. This works with both Immediate and Deferred SignalBehavior, can be done with any script type (exception: this will not work with a ReplicatedFirst LocalScript) and is not specific to any experience (i.e. it can happen anywhere).
game:GetService("Players").PlayerAdded:Connect(function (player)
player.PlayerGui.Name = "PlayerGui "
end)
Expected Behavior
CoreGui should be present at all times and should not be able to be influenced by developers aside from exposed APIs SetCore(GuiEnabled).
Actual Behavior
Due to dependencies from the CoreScripts on internal members of PlayerGui, the rename causes a permanent hang because the CoreScripts cannot find PlayerGui and call those internal methods. This results in the CoreGui being disabled.
In-experience result:
Studio output (F9 Developer Console is also disabled with this applied):
Workaround
There’s no developer-facing workaround for this issue besides not renaming PlayerGui (there shouldn’t be a reason to anyhow). For Roblox, it would be not to assume that there is a child named PlayerGui in the Player or to create a PlayerGui property that references the created PlayerGui so it has index precedence. PlayerGui is created with the player and is immediately available like the LocalPlayer to the client so finding it by ClassName instead may also work. This is internal code so I can only offer what I think I know as workarounds but they may not be the answer.
Issue Area: Engine
Issue Type: Other
Impact: Very High
Frequency: Very Rarely
Date First Experienced: 2022-09-18 18:09:00 (-04:00)
Date Last Experienced: 2022-09-18 18:09:00 (-04:00)