0 votes

I want my entire map in my 2D game world to be able to be scrolled with inertial scrolling. Any suggestions to accomplish this?

in Engine by (91 points)

1 Answer

+1 vote
Best answer
  1. Start with simple dragging for scroll effect e.g. map is scrolled only when you touch screen or are pressing mouse button
  2. modify your script to instead of actual dragging gave your map a speed that depends on how far user was trying to drag (map should run out from the screen)
  3. add friction to your map movement e.g. in each frame decrease its speed

  4. you've got yourself inertial scroll

by (1,022 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.