There isn’t an inertia function in that extension. Which is annoying because it does say that in the description, but I looked at it in the editor and there’s no inertia functionality at all:
That is all of the events in the extension, as you can see not even a hint of inertia, or bounds function. It is super basic so I would just make my own events for scrolling.
To get the momentum scroll, you would want a variable that keeps track of the current speed of mouse movement. So basically you would want to save the last position of the mouse each tic, then subtract that from the current position to get the size of the movement. Once the mouse/touch is released, use that number as your momentum to continue scrolling a bit. You would then taper off the scroll by modifying the number to get closer to 0.
Hi magicsofa,
thank you for your reply.
I saw this inside the extension, but the most tricky part for me was setting the correct positions of mouse/camera while swiping, after swiping and retouch.
To slow down scrolling via lerp is the best solution.
I solved the momentum scrolling by using SwipeGesture::DistanceY()*Friction
Also there’s to take care of ‘no momentum scrolling’ if user swipes and stops at a position and releases then mouse/touch, to avoid a uexpected scrolling.