Inventory GUI grid looks bad in-game

Im trying to make an drag + drop inventory system and to do that im making a grid… my only problem is the grid looks NOTHING like it does in studio.

How can i fix this?

In Studio:

In Game:

As you can see… BIG difference

also heres the children of each slot/cube for the grid:
Screenshot 2025-03-19 152838

How are you sizing the slots and their parents? Scale or offset?
Are you using a UIGridLayout or other UILayout? What are the properties on it?

1 Like

im using scale for everything and ui grid layout

grid layout properties:

This is what it looks like now:

2 Likes

Is there anyway i could get a working grid layout that works in both studio and game that i can use for reference?

1 Like

do you have a UIAspectRatioConstraint in the slot frame’s parent? (Slot6.Parent)

if not, add one (when it looks good) using an UI plugin and it should fix it.

you also kinda messed up your UIGridLayout properties. dont use a negative padding…

if you can, you can send a roblox file containing only your UI, and i can return a thorough response! :derp:

2 Likes

sorry its kinda late so ill let you know my plan some time early tommorow!

2 Likes

I recommend using UIListLayout with wrap and flex features enabled as it would better fit the grids in your frame. You can set the Y size of your elements to be 100% the height of your main frame and by having a UIListLayout with it’s direction set to horizontal and the “Wrap” property set to true.

2 Likes

Yeah, the negative padding doesn’t make sense.
And the different sizes are a mismatch between the desired frame size coming from the UIGridListLayout and the UIAspectRatioConstraint inside the frames themselves.
If anything you should have the AspectRatioConstraint on the parent frame and then let the grid items themselves just be controlled by the UIGridLayout.

3 Likes

That was my problem, the aspect ratio constraints were messing everything up, now it looks perfect, thanks for the help!

1 Like

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