What i’m trying to say is i want it to snap to a grid. You notice in the clash royal and app store video when they scroll it always lands on a specific part. Like tweening to that specific part i stead of being whatever the player went to it like automatically tweens itself to the specific area. For the app store whener you scrolled it would always put the next part on an app when they let go. On clash royal it would always put it on the players next tab when they let go. Is it possible to script that so it snaps like that? Its like how some games have grids when building so the player can edit without clipping but for gui. To snap to the closest tab grid when they let go of the scrolling thing
That requires a little bit of scripting and two buttons. Tween the CanvasPosition to a preset position that you’ve found when scrolling yourself. Once that script is written, disable ScrollingEnabled.
Do you know if i can get an example? Thank you this is really helpful
Edit: after look at your scrolling frame changed property it doesnt look like that would work since it would be trying to detect if something happened to the scrolling frame not the canvas position
ScrollingFrame.Changed:Connect(function(prop)
if prop == "CanvasPosition" then
-- this is pseudocode
if the item is the first one then
move position to second one
elseif the item is the second one then
move position to third one
-- etc.
end
end
end)
That’s why I’m checking if the CanvasPosition property was changed with the first if statement. If you want to try it with a print statement, go ahead.
ScrollingFrame.Changed:Connect(function(prop)
if prop == "CanvasPosition" then
if prop and Canvis.Position = 0,0 then
Canvas.Position = 1,1
elseif prop and Canvas.Position = 1,1 then
Canvas.Position = 2,2
—would be able to move back.
end
end
end)