NokiMo
Megan Fox
Megan Fox

patreon


FindChild Recursive (a handy util func)

Ever wanted to find a child under a GameObject, in recursive fashion, and been super annoyed when there wasn't a function for that? So you sigh, and crack open the editor, and write that logic for probably the tenth time in your codebase? WELL NEVER AGAIN.

Here's a handy dandy extension method that does that for you. Bonus, it even has an optional argument that tries to recursively find a child with the given name AND the given parent. This handles the cases where you've got 2 like-named children in the hierarchy, and want a specific one.

FindChild Recursive (a handy util func)

Related Creators