How to make a scrollingFrame auto scroll/position to the bottom?

When I started scripting this I thought it would be easy, but after trying everything I could think of nothing worked, some methods like setting the Y position of the scrolling frame to AbsoluteCanvasSize.Y only scrolled to the bottom halfway and setting the Y position of the scrolling frame to math.huge did nothing, I have looked thru each devforum topic related to this issue and tried all the answers, but none of them worked as well. Please someone help me figure this out.

local f = script.Parent

f.ChildAdded:Connect(function()
	f.CanvasPosition = Vector2.new(0, f.AbsoluteCanvasSize.Y) -- does not work even with setting this to math.huge
end)

As an last attempt I tried discord’s new chat AI bot Clyde which gave me the right answer

-- get the scrolling frame
local scrollingFrame = script.Parent

-- listen for child added events
scrollingFrame.ChildAdded:Connect(function(child)
  wait() -- delay for one frame to ensure child has been positioned

  -- set the canvasPosition to the bottom of the scrolling frame
  scrollingFrame.CanvasPosition = Vector2.new(0, scrollingFrame.CanvasSize.Y.Offset - scrollingFrame.AbsoluteSize.Y)
end)

(I changed the wait() line to game:GetService(“RunService”).RenderStepped:Wait())

1 Like

how

1 Like

what do you mean by “how”? (Original reply was “wdym”, but it was too short)

how did you do that

1 Like

I am guessing that you are referring to how I used the bot. The bot has been gives to a few servers to test and I got invited to one of them luckily, but the server asked not to share the invite link so I cant invite you there. U could just ask chatGPT since the discord bot uses the same AI as chatGPT.

can i see screenshots

1 Like

idk if this is bannable if I share discord but whatever

1 Like

its becoming more advanced :frowning:

1 Like

The more advanced it is the faster it advances, wont be long when our careers are destroyed.

1 Like

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