-
What do you want to achieve? Keep it simple and clear!
I want UI Objects in my recreated version of the ROBLOX explorer panel to stop overlapping. -
What is the issue? Include screenshots / videos if possible!
https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYzg2M3owOG83dGZ6Z2JtYnVzdTh5YjhrOW54ZGJsdXV3NjdwaTU5bCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/gyOqYNGxZBusCaxvMG/giphy.gif – wasn’t able to upload the video because of an uploading error.
UI Objects overlapping: ```
local function LoadInExplorer()
local ScreenGui = script.Parent:WaitForChild(“ScreenGui”)
for _, v in pairs(ScreenGui:WaitForChild("Explorer"):GetDescendants()) do
if not game:FindFirstChild(v.Name, true) and v:IsA("ImageLabel") or v:IsA("ImageButton") then
v:Destroy()
end
end
print(game:GetChildren())
local function FindParentLabel(child)
return ScreenGui:WaitForChild("Explorer"):FindFirstChild(child.Parent.Name, true)
end
local function RePositionInstances_init()
for _, v in pairs(ScreenGui:WaitForChild("Explorer"):GetDescendants()) do
end
end
local function RunLoop()
for index, v in pairs(game:GetDescendants()) do
--if v.Name ~= "ReplicatedStorage" and v.Name ~= "Workspace" and v.Name ~= "StarterGui" and v.Parent == game then continue end
if v.Name ~= "Workspace" and v.Parent == game then continue end
if ScreenGui:WaitForChild("Explorer"):FindFirstChild(v.Name, true) then continue end
local Text = game:GetService("ReplicatedStorage"):WaitForChild("Assets"):WaitForChild("Text_Label"):Clone()
if v.Parent == game then
Text.Parent = ScreenGui:WaitForChild("Explorer")
Text:SetAttribute("Load", false)
else
Text.Parent = ScreenGui:WaitForChild("Explorer"):FindFirstChild(v.Parent.Name, true)
if not Text:GetAttribute("Load") then
Text:SetAttribute("Load", true)
end
end
Text.Name = v.Name
Text.Text = v.Name
if Text.Parent then
if Text.Parent:GetAttribute("Load") == true then
Text:Destroy()
continue
end
end
Text.MouseButton1Click:Connect(function()
if Text:GetAttribute("Load") == true then
Text:SetAttribute("Load", false)
else
Text:SetAttribute("Load", true)
end
RunLoop()
end)
local function RePosition_Explorer_Instances()
local succ, errormssge = pcall(function()
if Text.Parent ~= ScreenGui:WaitForChild("Explorer") then
local X_Division = 1
Text.Position = UDim2.new(0 + (Text.Size.X.Scale / X_Division),0 + (Text.Size.X.Offset / X_Division), Text.Size.Y.Scale * #Text.Parent:GetDescendants(), Text.Size.Y.Offset * #Text.Parent:GetDescendants())
else
Text.Position = UDim2.new(0,0,Text.Size.Y.Scale * #Text.Parent:GetDescendants(),(Text.Size.Y.Offset * #Text.Parent:GetDescendants()))
end
end)
end
RePosition_Explorer_Instances()
end
--Position_Explorer_Instances()
end
RunLoop()
end