So I am making this system where I need to make it that the scrolling frame position is always at the bottom, so like by this I mean is that, it is always scrolling down automatically. Is there a way to do such thing?
Yes, simply increment the CanvasPosition’s Y Offset until you reach the CanvasSize’s Y Offset.
Oh god, thanks, I forgot that thing existed. Bruh momento.
local TweenService = game:GetService("TweenService")
Y = script.Parent.AbsoluteSize.Y --| ScreenGui
Scrolling = script.Parent.Scrolling --| ScrollingFrame
function TweenCreate(Obj,Pos)
local Props = {CanvasPosition = Pos}
local Info = TweenInfo.new(1)
local T = TweenService:Create(Obj,Info,Props)
T:Play()
end
function Move()
Scrolling.CanvasPosition = Vector2.new(0,Y)
TweenCreate(Scrolling,Vector2.new(0,0))
end
It only remains to connect the Move function.
I wouldn’t recommend using a tween due to varying lengths reading speed awkwardness.
Please do research on instances you are asking about first. This is a page to the ScrollingFrame instance in the developer hub.
You probably want to use the ChildAdded
& ChildRemoved
events to connect to a function that sets the frame canvas’ Y position to the amount of children.
If the code continues, just use Completed.
This isn’t what they’re asking to do as far as I can tell. Also your reasoning makes no sense.
I thought they were asking for the property of the ScrollingFrame
instance to use.
What I mean is that a scrolling frame could be 800 pixels long or 20000 pixels long and you don’t consider that, there should at least be a pixelSpeed
consideration which is counted and multiplied onto the length to obtain a more reasonable tween duration.
Configures how long it should take.
You just have to test the code and see what speed is more comfortable.
Yes I know what it does and how it does it, I’m just saying that the time for an extremely long frame and an extremely short frame would be the same, and that unfairly.