How could I accomplish inertia scrolling simply?

I’m interested in creating inertia scrolling in place of use of a ScrollingFrame so that I can have full control over scroll behaviour and so that the minimum and maximum bounds of the content frames don’t cause abrupt stops when met. Think mobile scrolling.

I did a bit of my own research and found a resource that can help me with this: ScrollingFrame by Quenty in NevermoreEngine. I dislike this however. It’s not simple to understand, there’s a lack of documentation and I hate how many modules it uses. I do not want to put so many modules, or install all of NevermoreEngine, just to use a single feature.

From what I can understand, the primary point of achieving inertia scrolling is using a spring. I was able to get this accomplished by using a non-terminating loop, Heartbeat and updating a ScrollingFrame’s CanvasPosition with the help of GetMouseDelta. Obviously not ideal.

  • Achieves smooth vertical scrolling by allowing the mouse to hold and drag left or right, but still bound to CanvasPosition limits. When it reaches the minimum or maximum, it abruptly stops, it doesn’t allow any value over.

  • Not a spring-based solution. ScrollingFrames don’t allow any value under the minimum or over the maximum, so I can’t introduce a spring to make the bar “recenter” back to the contents.

tl;dr Would like someone to point me in the right direction about inertia scrolling, since I’m not sure how to achieve it; specifically the principles behind how to get it done. If anyone can make heads or tails of the aforementioned NevermoreEngine ScrollingFrame module, that’d be great too. Yes, it does what I want, but it’s a non-solution because of all the bulk it comes with.

EDIT: Reference media from the web:

2 Likes