I’m trying to learn Babylon reading the guides and following tutorials.
I have a question about something that was explained to me in a different way.
Basically, if I want to select a mesh imported using a .glb file, how can I do it after this was imported?
I explain better. I know that you can import a file and after adding it include the .then(function()) to execute additional commands (such as adding a material, etc.).
What if I want to do that outside the function? For example, if I want to hide an element on click or move one of the meshes when something happens, is there a way to?
I have this playground I’m working on that includes some diamonds and the floor.
When I add the shadows, I need to create the shadow generator inside the .then(function()) to add each single element to the shadow Caster array. But let’s say I have some imported models and some primitives generated directly in Babylon… Is there a way to say for example:
[shadowGenerator.addShadowCaster(diam.meshes, true);](https://shadowGenerator.addShadowCaster(diam.meshes, true)
outside the function executed right after the import command? In this way I can add also the primitives and keep the code in order.
Thank you very much for your help!