Hi, the ScrollingFrame scrolls to a point in my game and can’t reach other boxes. Is there anyway to fix this?
This is what I mean:
I am using UIGidLayout for the layout
Can you show us your script? If you have one…
I don’t have one. I didn’t think i’d need one.
If you’re not using a script, you should just need to edit the CanvasSize property of your ScrollingFrame.
Which value? I tried editing Y but that made the boxes longer in height
Where is that option? 30 chars
That only changes its thickness though…?
Yes, that only changed its thickness. Not its length
This is what happens when you make the canvas size larger. Let’s say you have a canvas size of one on your scrolling frame, and you have a button on that frame that is half the Y of the canvas. The size of this button would be {???,???},{0.5,0}
. This would mean that the Y of the button would be half the Y of the scrolling frame. To fix this, you would change the size of the button accordingly. In my case, I would change the Y of the button to half of its current size {???,???},{0.25,0}
.
Still did not fix it. Why is this so complicated lol
The “scale” part of its size is basically what portion of the size of the parent it takes up
The most plausible resolution is from @DoctorBaconEater. I myself have tried it and it worked
“If you’re not using a script, you should just need to edit the CanvasSize property of your ScrollingFrame.”
If I have a frame that is 60 pixels tall, and I have a button in it which has a Size.Y.Scale
of 0.5
, then the button will be 30 pixels tall
The CanvasSize
of a scrollingframe basically makes it “taller” or “wider”, but you have to scroll to see what isn’t visible
Would you know a script that would fix this?
Very useful piece of code right here
local function resize()
scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, UIGridLayout.AbsoluteContentSize.Y)
end
resize()
scrollingFrame.UIGridLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(resize)
It says that CanvasSize is not a member of UIGridLayout
Fixed a typo. That should’ve been AbsoluteContentSize