getChildMeshes doesn't return meshes that match the predicate

According to the documentation getChildMeshes accepts a second argument which is a predicate that can be used to filter the child meshes. I can’t get this to work. getChildMeshes returns an empty array even when one of the meshes matches the predicate.

In this PG - Babylon.js Playground you can see that getChildMeshes returns an empty array, but if I check to see if the first child mesh matches the predicate, it does.

Not sure why getChildMeshes is not working. getChildren is.

I think getChildMeshes might also be returning nodes. In my example, there is a light that is getting evaluated by the predicate. Good to know about getChildren, though. Is there a better way to figure out if a node is a mesh other than instanceof BABYLON.AbstractMesh?

Actually instanceof doesn’t work for me. Always returns false.

This is because they are not meshes but transformNodes:

To test the class, simply call node.getClassName() === “Mesh”