Quantcast
Channel: Answers for "Help to get access to the parent"
Browsing all 4 articles
Browse latest View live

Answer by Raresh

transform.parent.transform.parent.gameObject.GetComponent or something else you need

View Article



Answer by DoTA_KAMIKADzE

If you just want to get parent in second iteration (parent of parent) then: GameObject parent2 = transform.parent.parent.gameObject;//of course if parent might not be there then the second line of code...

View Article

Answer by Raresh

transform.parent.transform.parent.gameObject.GetComponent or something else you need

View Article

Answer by DoTA_KAMIKADzE

If you just want to get parent in second iteration (parent of parent) then: GameObject parent2 = transform.parent.parent.gameObject;//of course if parent might not be there then the second line of code...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images