I have problem with Auto Canvas Size for Shop UI With Using Scale

I want to make a Sword shop but I am stuck at Scrolling Frame.

I’m trying to make an auto canvas size like:

if there is a 5 Items in the shop, the canvas size must be fit with 5 Items
But If I add 3 more Items later, the canvas size must be fit with 8 Items

I looked some solutions but I found nothing :frowning:

This is my ScrollingFrame Properties
image

This is my UiListLayout Properties
image

And This is my Template’s properties
image

ItemList.CanvasSize = UDim2.new(0, 0, (ItemList.UIListLayout.AbsoluteContentSize.Y / 100) + (#ItemList:GetChildren() * -0.2352), 0)

This is my auto canvas size code but It doesn’t work for every device cuz the scale thing on UI’s

So please can someone explain me, how I’m do this with correct way :slight_smile:

Set AutomaticCanvasSize to Y, this will make it expand down

1 Like

I tried that, It doesn’t scroll very well

How?, what happen?, send an image of how it looks and how you want it to look

image
This when I opened the AutoCanvasSize and Used 1 line of code

If I add more Template inside of the ScrollingFrame, they’re going to outside of the ScrollingFrame but if I delete some Template now There will be a spaces!

ItemList.CanvasSize = UDim2.new(0, 0, (#ItemList:GetChildren() * 0.278), 0)

This is my code

I want to do; the canvas size must be perfectly fit it

Do you want the spaces removed? sets Padding of UIListLayout to 0, 0.

No not that, Like shop frame. They auto canvas sized depends on tool number