Preventing the camera from turning left and right

Hello, my original problem is very simple. I just want the camera to be zoomed in and out. The camera should not turn left or right.

I’m able to achieve this with “camera.inputs.remove(camera.inputs.attached.pointers);” but on mobile it prevents zooming in and out. Please your help.

Mesh Collision | Babylon.js Playground (babylonjs.com)

Hi,
Hope you are well. There are multiple ways you can do this. I guess it essentially depends on whether the camera (or cameras) will always be fixed or if it allows move at certain time/context.
If the behavior never changes, you can sure change the inputs. Else, you could simply act on the camera. In a number of ways. Here are a couple of twists in this PG.
On the other hand, if the camera only allows zoom (at all times), I should ask why use an arcRotateCamera?

4 Likes