How does getMeshesByID work?

Hello, in my example, Babylon.js Playground, I am grouping all meshes by a given ID so that I can easily change a property. However the function returns an empty array. What do I miss?

1 Like

Silly me, lights aren’t meshes. I need to query by light. Fixed in https://playground.babylonjs.com/#RY24EK#1

2 Likes

Just wanted to add for future reference - the scene has a getNodeByID function that will return any node type (mesh, light, camera, bone, in that order). If you can use getXXXById directly, do it, but if you don’t know what you are querying, we’ve got you covered :slight_smile:


Also the best for me is to search for it by name or tags.

1 Like