Momentum Scrolling?

Hey, has anybody ever done a Momentum Scrolling implementation via GDevelop?

Not urgent or anything, I’ve got a game where all the mechanics work at the moment. (So this would be a long term “update” for me that I’d look into getting deployed for V.2 of my project!)

Anyways, here’s the situation:

I’m currently using the “Drag Camera” action to achieve a scrolling mechanic. It works well enough, but it instantly stops scrolling as soon as you remove your finger from the screen.

Momentum Scrolling, as you may know, is essentially the standard these days, it tracks momentum and continues to scroll after you remove your finger, slowing down and eventually coming to a stop.

If you go to any website with your phone and scroll, you’ll see what I mean. Flick your finger up and the website will go scrolling by with “momentum” instead of stopping when your finger leaves the screen.

Eventually, I’ll probably get around to digging into this well enough to create my own javascript implementation of it, but I was wondering if anyone has done momentum scrolling via GDevelop before?

Thanks in advance for any help you might give. If no one knows, then I’ll update this thread in a year or two when I figure it out the hard way! LOL :slight_smile:

I don’t know but I’m glad you’re looking into this because I’ve been wondering too, so hopefully you will update this in a few years.

What about the bounce back scrolling, where when you scroll to the camera boundaries of the game it bounces back slightly when you let go. It’s something I’m wanting to do and seems like it would be easy enough to accomplish with events alone but I’ve been focused on other aspects of my project so have not worked on logic for it yet.

Have you considered using an object on which to focus the camera, adding physics behaviour to it with no gravity and a reasonably friction? Apply a force on the object dependent on the swipe gesture and create & add a joint if the object goes out of bounds to keep it within the required margins.