How to enable touch for FlyCamera?

This demo has no touch support, and it isn’t clear from the docs how to add touch support:

FlyCamera how to add touch??? | Babylon.js Playground (babylonjs.com)

How do we add touch support to it?

cc @PolygonalSun

Hey @trusktr,
AFAIK, the FlyCamera is an older camera that doesn’t fully support touch features (eg. gestures) but touch can be enabled by turning on the touchEnabled flag on the mouse input.

// Example code
const camera = new FlyCamera(/*...params...*/);
camera.inputs.attached.mouse.touchEnabled = true;

That should enable touch to work with the FlyCamera.

Looks like touch is already enabled in my app. But the only thing it can do is look around (single finger drag).

Can more touch features be enabled? For example is there a built-in way to make the camera move forward or backward, not just look around? Or do we need to disable the built-in touch controls and make something from scratch?

It doesn’t work. If I set touchEnabled = false inside a pointer event handler (because I need to add special handling when two pointers are down), and then set touchEnabled = true when I’m back down to 1 pointer so that we restore the Babylon’s functionality, FreeCamera controls simply stop working at all. They are never re-enabled. Free look with one finger doesn’t work anymore.

(Note, this is very easy to do in Three.js)