Hello I wanted to ask a question
How could I know an object who is his father or parent?
for ex: i have a object called knuckles and his father is arm. how can knuckles know it?
Hello I wanted to ask a question
How could I know an object who is his father or parent?
for ex: i have a object called knuckles and his father is arm. how can knuckles know it?
Here ya go: Transform.parent
transform.root is handy as well. root is very top level transform
Who an objects father is is a narrative point that a good writer will solve for you. Or you can pick the obvious cliche and make it the villain. The general quest to find ones identity by locating ones father is a fairly common theme.
For finding an objects parent its as simple as Transform.parent. Anything related to position, rotation, movement, or the hierarchy is on Transform.
thanks all.
i think i can use transform.root
but this will return a transfrom , doesn´t return one object i need to use the object. what can i do?
something like this ??
transform.root.gameobject