Getting all MeshInstance3Ds from scene

Godot Version



How could I get all MeshInstance3D Nodes from a given scene when children run multiple levels deep? Normally, I would use a for loop to get all children, but I have mesh instances buried beneath other mesh instances, and making a multi-level for loop does not seem like the right move. What would be the best method for getting all the meshes in a non-recursive way, if at all possible?

You could try using Node.find_children() like var instances = find_children("*", "MeshInstance3D", true, false)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.