I’m trying to make a player list GUI, but when I clone the player frame that I have in replicated storage to a frame, it renders on the bottom and the player can’t see it. The ZIndex is high on the player frame, but still is on the bottom. I have no idea why.
If you need more info let me know
local repStorage = game.ReplicatedStorage
local playerList = repStorage:WaitForChild("players")
local playerTag = repStorage:WaitForChild("playerTag")
local numPlayersLoaded = 0
playerList.ChildAdded:Connect(function(player)
print("Player Added")
for _, i in pairs(playerList:GetChildren()) do
local pt = playerTag:Clone()
pt.Parent = game.StarterGui.ScreenGui.Frame["Player List"]
pt.Position = playerTag.Position - UDim2.new(0,0,0, numPlayersLoaded*50)
pt.TextLabel.Text = player.Name
numPlayersLoaded = numPlayersLoaded+1
end
end)
I believe UI elements nested deeper are always rendered on top of more shallowly nested objects no matter what the ZIndex is set to. ZIndex only defines the order of children that are nested at the same level in the same object(?)
You can fix this by setting your ScreenGui’s ZIndexBehavior property to “Global” instead of “Sibling”. This will make the ZIndex property act as a “global” depth control. Be aware that doing this might require you to adjust some of the z-indexes on your other UI components.