UI doesn't show up after cloned by local script

My goal is that the Black Frame that is not seen (because it’s in startergui, not in a screengui) gets cloned and put into the white frame and becomes visible.

I don’t know if Roblox is bugging or I am, but after cloning a black frame and making its parent the white frame, it just doesn’t appear. When I play the game, the black frame clone is inside the white frame in the Explorer, and the visible property is on, but it’s invisible.

Local Script Code:

local black = game.StarterGui.Black
local white = game.StarterGui.ScreenGui.White

local clone = black:Clone()

clone.Parent = white

How it’s sorted:

How the frames look (I moved the black frame into the screengui so it’s visible):

The issue is that you are cloning to the startergui, you need to clone it to the playergui.

local Player = game:GetService("Players").LocalPlayer

local PlayerGui = Player.PlayerGui

local ScreenGui = PlayerGui:WaitForChild("ScreenGui") -- Clone Here!!!!

-- Your previous code
clone.Parent = ScreenGui

The best way to put it, is your are cloning to the startergui, which i believe if you reset your character you should see the black box after. The frame has a .Visible property under it you should use that instead, since it is better than cloning.

clone.Visible = true -- Visible.
task.wait(1)
clone.Visible = false -- Makes invisible
4 Likes

Make sure you position it correctly. AnchorPoint & Position are very important in this regard.

local black = game.StarterGui.Black -- i recommend putting it into the screengui
                                    -- and just changing Visible property
local white = script.Parent.White

local clone = black:Clone()
clone.Parent = white

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.