Checking a part using their descendants

Hello! @Enchanted_Tix here and I was doing something on my game. Like always, I have a decent problem. But we don’t know if we call this “decent”. So I had a post a few days ago called, “Descendants?;Recursion?”. It was similar to this topic, but people weren’t answering the real question. The question was: “How do you locate a part using their descendant no matter where they are (explorer) and what the located part’s parent is.” Please comment and if you have time show me an example script. Before I end this post, I have to do an example. If I had a normal part in a model in workspace. And inside the part it had a value named, “_Part”. How would you locate that part?

In all honesty, I’m not entirely sure what you’re asking but, I’ll try to answer this to the best of my ability.

If you want to find a part no matter it’s location, this is possible through recursion. There’s actually a neat article on this concept and it provides a code example at the bottom that, when modified, can fit your needs.

So we worked with this together, and I came up with a solution and successfully solved his problem.

1 Like

What is supposed to be in ‘value’?

Mind posting the solution so that others with the same question can see how this problem was resolved, as opposed to a statement saying this was resolved?

1 Like