Hello, Than you for this grate framework!
I’m trying to build a real time strategy game.
I want to use InstanceMesh to duplicate one mesh for all the objects of the same unite, i. e. all the jeeps should be an instance of one same mesh.
So I import the mesh and make it invisible.
The problem is that the mesh have 3 meaterails and only the first became invisible.
This is hapening with “isVisible” and “setEnable”.
I’m using obj format from Blender (I tryed gltf but got other problems, probablly be in another post).
I’m writing the code in Typescript.
I know I should load it to play ground, is there a way to upload multiple files in Typescript to a playground?
Here is the important bits of the code, (I’m hope I’m not missing anything:
The Loader:
…
BABYLON.SceneLoader.ImportMesh("", “./mesh/” + key + “/”, meshList[key][“obj”], this.scene, (mesh) => {
mesh[0].isVisible = false;
this.meshesLibrary.set(key, mesh[0] as BABYLON.Mesh);
meshesCounter++;
if (meshesCounter === numberOfMeshes) resolve();
…
The instance creation:
…
let ground2 = new BABYLON.InstancedMesh("", this.meshLoader.getMeshLibrary().get(“ground”));
…
The instansing actually work OK.
Any help would be greate