Limit FirstPersonControls to only 1 mouse button?

Hello all, quite new to threejs and Javascript in general.

I was just wondering if there was a way to limit the movement in FirstPersonControls so that the camera only moves when the left mouse button is held.

You have to slightly modify THREE.FirstPersonControls to achieve this. Just remove the following two lines:

In this way, the controls don’t react on any keyboard input. If you also want no camera movement when the mouse moves (look around), remove the mousemove event listener.

1 Like