Drag camera with the mouse extension - inertia missing

Hi,

I’m loocking for the action/function ‘Configurable inertia and bounds’ as wrote in the extension ‘drag camera with the mouse (or touchscreen)’.

There’s only a basic function for draging camera in direction to find.
Need the inertia function for scrolling lists…like a Momentum Scrolling.

Thank you for help.

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.

Yeah, you could set a threshold for how fast the swipe is going before release. So basically your condition would be something like:

mouse button released/touch ended
SwipeGesture::DistanceY() > ScrollThreshold

Where ScrollThreshold will be a number representing the swipe distance that you have to exceed in order to keep rolling.