Skip to content

Instantly share code, notes, and snippets.

@PranavSK
Created March 24, 2021 05:27
Show Gist options
  • Save PranavSK/aa9517d6c3d1a95579f7406c827afa18 to your computer and use it in GitHub Desktop.
Save PranavSK/aa9517d6c3d1a95579f7406c827afa18 to your computer and use it in GitHub Desktop.
class_name NodeUtils
static func get_children_of_type(node: Node, type) -> Array:
var ret: = []
for child in node.get_children():
if child is type:
ret.append(child)
if child.get_child_count() > 0:
ret += get_children_of_type(child, type)
return ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment