Inventory Gui Problem

I’ve been working on an Inventory Gui that uses a UIGridLayout Constraint, but when the amount of items in my inventory exceeds a certain amount of items, the Scrolling Frame doesn’t allow you to see the rest of the weapons. Ive tried making a script that extends the scrolling bar but it messes up the size of the items.

Scrolling frame with intended item size:

Scrolling frame with item size after I use the script:

(I cropped the videos so you dont have to watch me press a button 100 times)

Then I tried manually changing the CanvasSize of the scrolling frame to see what the problem was.

When I leave the Y scale as 2:

When I Change the Y Scale to 5:
scale3

Script:

local grid = script.Parent.InventoryFrame.ItemsList.Items.UIGridLayout
local scrollingFrame = script.Parent.InventoryFrame.ItemsList
local items = script.Parent.InventoryFrame.ItemsList.Items

items.ChildAdded:Connect(function()
	scrollingFrame.CanvasSize = UDim2.new(0,grid.AbsoluteContentSize.X,0,grid.AbsoluteContentSize.Y)
end)

Use UIAspectRatioConstraint My dude. place it in the Scrolling frame.

1 Like