I recentlly wanted to make my own auto scale for scolling frame because roblox one doesnt work like I want it to. Here is example what I need it for and whats the problem with my current one that I tried to make:
other issue is that it should load on every device about the same so no gaps at the bottom (unless I want to add some pixels for texts or buttons at the very bottom)
Here is my current script: (its testing place)
local Canva = script.Parent.Reviews
local CanvasStartingAS = Canva.AbsoluteSize
print(CanvasStartingAS)
local function scaleCanvas()
local FrameAS = Canva.Frame.AbsoluteSize.Y * 0.9
Canva.CanvasSize = UDim2.fromScale(0, ((#Canva:GetChildren() - 2) * FrameAS) / (CanvasStartingAS.Y))
end
for i = 1, 150, 1 do
local NewFrame = script.Frame:Clone()
NewFrame.Parent = Canva
NewFrame.BackgroundColor3 = Color3.fromRGB(math.random(1, 255), math.random(1, 255), math.random(1, 255))
scaleCanvas()
task.wait()
end
but thats not really the problem I am having atm, the main thing is that when I use auto canvas then there is a delay between it detects that childs were added and it sometimes makes the scrolling bar bigger only if u get to the bottom. This couses loading frames to act weird because I load 10 at the time and check if you are at the bottom of the page before loading more. With auto cavas it detectes it many times and keeps loading frames so when you actually want to read something it moves your canvas position around and there is nothing I can do about it.
Are you sure that this works on every device? Because if you are playing with offset, it might do something weird on mobile. (When you add 100 to the AbsoluteContentSize) I’ve tried something similar and it just scaled every frame each time one was added to the scrolling frame.