Topic was automatically imported from the old Question2Answer platform.
Asked By
DanielLC
I need the equivalent of Object.FindObjectsOfType() from Unity, where I get every object running that class or a subclass of it. I can’t find out how to do it anywhere. I’ve found get_tree().get_nodes_in_group(), but apparently a group isn’t referring to a class because I’m getting an empty list.
I’m about 3 months new to godot so I may need correcting but I’ve learned that the function ‘is_class’ disregards class_name declarations so this wont be able to filter custom classes.
However, if you preload the class as a resource at the top of your script you can reference that instead of passing this function a sting as the middle parameter.