#UI frame cloning but not visible

1 messages · Page 1 of 1 (latest)

winged pike
#

Hey y'all, still super stuck on this. If anyone has any idea please lmk

I'm working on a quests page for my game, and I'm having trouble getting my frames to clone correctly. I have a "questsContainer" with a UI grid and I created a template frame inside it, and configured the UI grid with cell size and padding and everything. So when I manually duplicate the frame in the explorer, it populates just fine into the grid, but when I try to clone the frame in my script, I'm running into problems.

I can see the frame being cloned if I open the explorer during gameplay, but I can't see it on the screen. I'll send a video of this too. I've tried setting Visible to true, messing with the ZIndex and background transparency/color, making sure the size and position are correct, and nothing is working.

This is the code I'm working with:

local quests = GetQuests:InvokeServer(player)
print("Quests", quests)
--Prints as expected
--Loop through quests to create frames:
local questTemplate = questsContainer:WaitForChild("QuestFrame")
for _, quest in pairs(quests) do
    local newFrame = questTemplate:Clone()
    --This works, showing up in Explorer, all style tags applied
    newFrame.Visible = true
    newFrame.Size = UDim2.new(1, 0, 1, 0)
    newFrame.Parent = questsContainer
    newFrame.AnchorPoint = Vector2.new(0.5, 0.5)
    newFrame.Position = UDim2.new(0.1, 0, 0.1, 0)
end

The style tags are applying correctly and the frame is parented correctly, so supposedly AnchorPoint and Position are set automatically, but I've also tried setting them manually, like above, and nothing changes. I have no idea what to do atp 😭

sullen meteor
winged pike
sullen meteor
# winged pike What would you recommend to find out which one?

i would recommend to print the state of everything, so do:

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
    local playerGui: PlayerGui = player:WaitForChild("PlayerGui")
    local PositionOfFrame = playerGui:FindFirstChild("ScreenGui") -- < You replace the ScreenGui i set to what you parent the Frame to.
    
    for i, v in PositionOfFrame:GetDescendants() do
        if v:IsA("Frame") or v:IsA("ScreenGui") then
            print(v.Visible)
        end
    end
end) 

if anything returns false, you just turn it true or you check what it's supposed to do and turn them to true to those that should be true

winged pike
sullen meteor
#

i didnt do anything