Issue with camera attach, detach in 5.0.0

I don’t know what changed, and maybe that’s important to figure out.

But if looking only for a solution, then I suspect this is due to global event handlers being problematic. I believe the BJS team generally recommends using the observables instead. Here’s an alternative with observables that doesn’t have the problem:

    scene.onPointerObservable.add(pointerInfo => {
        if (pointerInfo.type === BABYLON.PointerEventTypes.POINTERDOWN) {
            if (firstTime) {
                console.log("pointer down, detaching control");
                camera.detachControl();
            }
        }
        else if (pointerInfo.type === BABYLON.PointerEventTypes.POINTERUP) {
            if (firstTime) {
                console.log("pointer up, attaching control");
                camera.attachControl(canvas, true);
                firstTime=false;
            }            
        }
    })