I’m making a color selector and, due to laziness, I didn’t want to manually make each button for every available color, so I made a quick and easy little system to automatically create the UI elements via a UIGridLayout:
local function initColorSelection()
for i,v in pairs(colors) do
local template = templates:FindFirstChild("ColorPlaceholder"):Clone()
template.Parent = colorFrame
template.Name = i
template.Visible = true
template.BackgroundColor3 = v.Color
end
end
initColorSelection()
As you can see, it is very simple. It copies a UI element from a template and changes its properties a bit. One problem: The copied UI elements will not show up no matter what. I’ve tried changing zindex, visibility, and background transparency.
They are there, their properties are changed, and they’re in the right spot in my frame, but they’re not visible. I’ve changed the background transparency of every UI element in my game to no avail to see if it was a zindex issue, but they were still invisible.
Their .visible property is true, they aren’t transparent, and their ScreenGUI parent is enabled. What could be causing this?
Edit: If it helps, the frame I’m using is a gradient from the InterfaceTools plugin, though I compared it’s settings with those of a normal frame and they appeared to be the same. I’m also accessing the StarterGui service instead of referencing UI elements with script.Parent, as the script is located within a tool.