I want to create instances of an Imported mesh, is that possible?
I’m using Typescript and importing a mesh with ImportMeshAsync
eg.:
const importResult = await SceneLoader.ImportMeshAsync(null, "/assets/", "stuff.gltf", this.scene)
const mesh = importResult.meshes[0]
mesh.isVisible = false
for (var index = 0; index < 2; index++) {
let newInstance = mesh.createInstance("i" + index)
}
But TS gives an error since the import result meshes are AbstractMeshes and createInstance()
is not a valid method for them.
What would be the correct approach here if I want to make instances of the imported mesh?
From the docs: Instances | Babylon.js Documentation