Hi! I’m working on a local typescript project that needs a 2D interface with buttons. I have intalled the babylonjs/gui package so i can use AdvanceDynamicTexture and Button classes but when i use
const advancedTexture = AdvancedDynamicTexture.CreateFullscreenUI("UI", true, this.scene, Texture.BILINEAR_SAMPLINGMODE, false);
This error takes place.
Argument of type 'import(".../node_modules/@babylonjs/core/scene").Scene' is not assignable to parameter of type 'import(".../node_modules/@babylonjs/gui/node_modules/@babylonjs/core/scene").Scene'.
Type 'Scene' is missing the following properties from type 'Scene': skipPointerDownPicking, _materialsRenderTargets, _geometriesByUniqueId, _activeMeshesFrozenButKeepClipping, and 2 more.
It seem like the Scene class from babylon/core/scene is not the same as the one in the babylon/gui package.
This is my package.json dependencies if that helps.
"dependencies": {
"@babylonjs/core": "^5.0.0-beta.11",
"@babylonjs/gui": "^5.4.0",
"@babylonjs/loaders": "^5.0.0-beta.11",
"vue": "^3.2.13"
},
I didn’t find this error in any forum because everyone uses de babylon playground and when they call AdvancedDynamicTexture.CreateFullscreenUI() they only have to specify the name of the UI.
AdvancedDynamicTexture.CreateFullscreenUI("UI");
What can i do?