Help with auto scrolling frame

Hi guys, I need some help here;

if (currentButton.Parent.Parent:IsA("ScrollingFrame")) then -- auto scroll
					local TMP = currentButton.Parent
					local ScrollingFrame = currentButton.Parent.Parent
					local X = (TMP.AbsolutePosition.Y/ScrollingFrame.AbsoluteSize.Y) * (TMP.AbsoluteSize.Y/2+ScrollingFrame.CanvasPosition.Y)
					local TweenTo = Vector2.new(0,X)
					print(TweenTo)
					ScrollingFrame.CanvasPosition = TweenTo
				end

The trouble is;
Is not exactly perfect and it won’t work very well sometimes


That’s video ^
Main Trouble is when scrolling back up I think

Anyone knows what’s causing it?
I can provide more info if so, please help D:

Something like this?
robloxapp-20210126-1225252.wmv (83,5 KB)

Not really, it’s meant to auto-scroll acording to current button position. (current button is the button in blue)
And TMP is the viewport frame, Current Button is inside TMP

i tried but its super buggy https://gyazo.com/cce7759cc8865cb4cd8e0f07631c64d5 :confused:

What’s the code? If you could show me :smiley:
It looks clean!

I was writing this other thing and tried doing a 2 player server and it crashed the baseplate and I lost all progress :frowning_face:

1 Like

Just fixed it on my own, thanks everyone though!