Noticed this bug/issue while migrating from 5.0.0-alpha.14 to 5.0.0-beta.7
Seems to be introduced on 5.0.0-beta.4, previous versions work as expected.
scene.attachControls() no longer working when using multi canvases and defining inputElement after scene is initialized. Events are not captured.
Unfortunately I can’t use the playground in order to demo the multi canvas approach, so please bear with me.
- Create the engine with a working canvas, initialize the scene and camera
var canvas = document.createElement("canvas"); var engine = new BABYLON.Engine(canvas, true); var scene = new BABYLON.Scene(engine); var camera = ...
engine.registerViewfor the actual canvas element for output
engine.registerView(outputCanvas, camera, true);
- Following instructions here, attach controls - last line doesn’t work, no events captured, no errors
scene.detachControl(); engine.inputElement = outputCanvas; scene.attachControl();