Quantcast
Channel: Questions in topic: "parenting"
Viewing all articles
Browse latest Browse all 302

how do I access the topmost parent of an object with multiple parents

$
0
0
I'm trying to access the variables of the topmost parent of a multi-level hierarchy (with multiple "generations" of parents, so to speak) directly without using GameObject.Find() or the like (which require a lot of processor overhead if there are many parents.) I can't seem to find any way other than GameObject.Find() and other 'search' functions like it. As far as I'm aware, "transform.parent" only returns the immediate parent. I'd prefer to access it somewhat directly like "transform.parent" allows (if at all possible), so is there any generic way to do that quickly, easily, and efficiently?

Viewing all articles
Browse latest Browse all 302

Trending Articles