Hi again, issam… I am doing ok, thx. I hope same for you.
First, you might need this line (after camera is created):
camera.panningMouseButton = 0;
Then…
#1. camera.buttons = [2, 1, 0];
(should work) (default is [0,1,2])
#2. camera.panningSensibility = 30;
(default = 1000)
I think that will all work. https://www.babylonjs-playground.com/#VE33T#14
Let’s listen for more comments, too, though. I could be telling you bad things.
Also, be prepared for possible “trouble” when your scene uses touch-screen pinch/swipe gestures, VR headgear/gloves, stylus pens, flight sticks, and/or gamepads. Not sure. You might wish to offer a game option… that allows users to choose swapped buttons… or not.
This thread might be pertinent, too: Input Manager to rule them all
We CAN make is so click-on-mesh (animate-to-mesh) only works for ONE of the buttons (it currently works for both buttons). But… I think that will require adding actionManagers to each clicked mesh… instead of using the scene.onPointerObservable
seen in lines 64-96. The scene.onPointerObservable system does not have an exclusive (discrete?) event for right-button pick/click. BUT… I might not know all the power available with scene.onPointerObservable (such as advanced ways to filter/determine WHICH button did the clicking - sometimes called masking.)