Panning by means of touch

Recommended Posts

Hi All,

I would like to use babylonjs from a touch device.

Zoom in and zoom out by means of pinch works in a touch device (mobile/ tablet)


Panning works on pc by holding CTRL+Drag.

What is the best way to implement panning on a touch device ? 

one touch drag would rotate the scene.

Will it be possible if I want to use 2 touches and drag to pan ?



Share this post

Link to post
Share on other sites


first of all you can turn off touch to rotate by not calling camera.attachControl.

If you want to add panning with 2 fingers, I recommend adding an event handler for pointerDown event.

A good read: https://blogs.msdn.microsoft.com/davrous/2015/08/10/unifying-touch-and-mouse-how-pointer-events-will-make-cross-browsers-touch-support-easy/

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.