How to get "universal" parent

So say im making a script for example, where when you click on the part, it prints the parts name if the part is in a folder, called “objects” for example, but what if you have a model in the object folder?

because when checking if part is in the objects folder, part.Parent.Name == “Objects” does not work anymore with models, because part.Parent.Name would be the parts Model Name

Whats the most effective way to get around this?

Thanks in advance

I believe you should use Part:FindFirstAncestor("Object name")

ah thank you, never knew that existed

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.