Cmexxx
March 31, 2022, 11:13pm
1
I’ve tried to create a block with number.
I’ve seen this example https://playground.babylonjs.com/#ZI9AK7#2103
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';
advancedTexture.addControl(button1);
Dad72
March 31, 2022, 11:43pm
2
Hi,
works here:
In your code you forgot BABYLON.*
2 Likes
Cmexxx
April 1, 2022, 7:22am
3
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
Cmexxx
April 2, 2022, 7:57am
5
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.
2 Likes