UIGridLayout Not A Grid Layout

local ui = script.demo:Clone()
ui.Parent = script.Parent

Screen Shot 2021-01-24 at 10.13.33 AM

When I manually put it in, it works

I have a UIGridLayout in script.Parent but when I look at 2+ they are on top of each other

When you move demo to the parent of the script, then duplicate demo, are they still on top of each other?

Yes, when I set it to the parent, they are still on top of each other

Is script.Parent a scrolling frame?

Nope, script.Parent is a regular frame.

So if you arrange your uis like this it still overlaps
image

No

When I manually put it in, it works

Screen Shot 2021-01-24 at 10.17.29 AM

And you’re sure the script is running?

The script is running, all of it works except the grid layout

I was using ClearAllChildren() which deleted the UIGridLayout