How to check if two sharedMesh "points" to same original mesh

Hi!

Sadly, if you get two different MeshFilters and compare their .sharedMesh, results in not the same, even if they are sourced on the very same mesh.

in C#:

// Two mesh filters from the same mesh
a.GetComponent<MeshFilter>().sharedMesh == b.GetComponent<MeshFilter>().sharedMesh // false

So, how can one compare this? Do I have to compare every vertex and triangle on each sharedMesh to check if they are the same?

If they point to the same mesh then the sharedMesh property will == to true. If this isn’t the case, then you must have assigned their meshes using .mesh, which will crease a clone.