Source of an instance

Hi,

in my scene, there are instances of several meshes.
Instances can be identified with isAnInstance.
But how to get a reference to the source mesh?
In Api, there is “souce”, also in the debugger.
But in my script, source is always “undefined”.

Here is a snippet:

scene.meshes.forEach(function(mesh){
         console.log(mesh.name + " <= " + mesh.source);
}

What am I doing wrong???

THX
Stefan

Hi @Stefan70 and welcome to the forum.

source only returns source mesh for a clone not an instance

https://doc.babylonjs.com/api/classes/babylon.mesh#source

https://www.babylonjs-playground.com/#QAAZZM

Hi,

i got it, its sourceMesh and now everything works fine :slight_smile:
My Problem was adding a instance to a highLightLayer ist not possible, so i need to add the sourceMesh.

3 Likes