How to automatically move children elements in view?

image
I would like to, upon click, for the canvas to scroll until frame is fully in view. How would I do this? I’m using an UIListLayout with a ScrollingFrame.

uhhhh,

something like this, probably;

frame.Activated:Connect(function()
   scrollingFrame.CanvasPosition = frame.Position
end)

I don’t think that works because frame’s Position is overriden by UIListLayout and the AbsolutePosition of the frame isn’t a good measurement as it’s the position on the screen, not of that specific frame

Do you mean if you were to click that green button all the way on the left you want it to become centered?


Maybe this will help you with demonstration. Not centered, but rather just into full view. Same if I were to click an element on the right.

The absolute position is relative to the frame so you can do

Canvas.CanvasPosition.X = Frame.AbsoluteValue.X