How to grab all robots in the scene with a script

hey guys

basically I am trying to find the easiest way to grab all the robots in a scene and put them into an array.
right now I am using a simulation node list property and dragging in all the robots in the scene manually.

I want to grab them from script. only way I have though of so far is cycling through all the components using a for loop and checking if the are robots and if they are add them to the array but it doesn’t seem like an efficient way of coding it. but maybe that’s the only way?

would love to hear if there is a better way. Thanks

Not really as far a I know. Robots are just components like any other.
Have you found iterating through all components too slow or is this just a theoretical question?

Identifying if a component is a “robot” or not could be done in different ways, some potentially faster but less accurate.

Hey thanks

I guess you could say it was more of a theoretical question I don’t think performance will be an issue since this will only be performed once and is not being performed on something like onUpdate.

I was just asking to see if there was a better solution I am trying to develop good practices. thanks for the reply though.