Finding Highest Level Parent of an Object

Hi,

I know it’s pretty easy to get the parent of the current object, but what if you have a hierarchy of parents: How do I find the parent of the parent of the parent of the parent, etc., in other words the highest level parent of the current object?

Use transform.root to get the root of the hierarchy tree.