Hi everyone, im kinda new in BabylonJS. im try to get an event pointer to work on a button using the GUI. json file. json event loaded successfully. I can also console btnStart object. But events doesnt work so far, am i missing something.
var advancedTexture =
BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("GUI");
let loadGUI = await advancedTexture.parseFromURLAsync("/assets/json/ui.json");
if (loadGUI) {
let btn = advancedTexture.getControlByName("btnStart");
let panel = advancedTexture.getControlByName("panel");
btn.onPointerClickObservable.add(function () {
btn.isVisible = false;
console.log(btn);
});
}