Grid Layout's spacing is broken. By A LOT.

Hello people, this is my first post and I am not a pro at unity, please excuse my limited knowledge.

So, I was trying to use the Grid Layout Group to create a grid for level selection, but when I applied it, this happened.
(The Picture: All the Images I roughly aligned got spread out like crazy, without me touching any settings at all.)


(Incase the picture not loading, here is an imgur link: Imgur: The magic of the Internet)

I went and tried to change all the numbers and settings under the Grid Layout Group, like making the spacing negative, nothing worked.
I even created a brand new project just to see if I accidently messed with any settings, and it was the same.

I looked all over the place, no one seems to have the same problem as I do, and by watching Youtube videos, I see that their grids do not act like mine (such as this one: )

How can I fix this? Not being able to create grids is very painful and annoying, any help is apricated :slight_smile:

I just noticed that you have scale set to 11.762 4.5 can’t tell for sure that it’s the main culprit for this, but when working with UGUI you should keep the scale of everything at 1 1 1. Use the width/height or top/bottom/left/right properties to control the size, instead of scale.

1 Like

Besides the scale using weird values, also be aware that if you don’t set fixed column or row counts (check the Constraint values), the grid layout will try to fit your objects automatically. If you only have space for 1 item per row, it’ll look like a single column grid. If you want more items per row (i.e. more columns) you need to make your width larger.

1 Like

Thank you, That fixed the issue! I didn’t know it would make a difference and basically was using Scale for everything. XD

Thanks! That’s good to know, it would definitely come in handy.