GUI.AdvancedDynamicTexture.CreateForMesh makes my mesh invisible?

I’ve tried to create a block with number.
I’ve seen this example
But in my code it doesn’t work
I can’t see it in the scene

    let plane = MeshBuilder.CreateBox("plane",{size: 2}, this.scene);
    plane.position.y = 2;
    plane.rotate(new Vector3(1,0,0), 1.57);

    let advancedTexture = GUI.AdvancedDynamicTexture.CreateForMesh(plane, 1024, 1024);

    var button1 = GUI.Button.CreateSimpleButton("but1", "Click Me");
    button1.background = 'green';

works here:

In your code you forgot BABYLON.*


I added BABYLON before all meshes, cameras, engine etc…
Now I have Uncaught TypeError: BABYLON.Engine is not a constructor

Do you reference the babylon library in your page ? and if so how ?

1 Like

So the problem was in the way how I import modules, Project set up guide suggested to import from babylonjs/core Getting Set Up | Babylon.js Documentation.
I replaced it with babylonjs and everything works correctly.