Quantcast
Channel: Questions in topic: "get"
Viewing all articles
Browse latest Browse all 215

How do you get child and grandchild?

$
0
0
I have a GameObject which contains children and grandchildren. I would like to change the layers of the entire Parent folder with another layer. Currently the parent and her children I was able to change layers, I add grand to child and it didn't work, it was the same results as I typed child. I have 6 children who have children themselves. newBuilding.gameObject.layer = 0; foreach (Transform child in newBuilding.transform) child.gameObject.layer = 0; foreach (Transform grandChild in newBuilding.transform) grandChild.gameObject.layer = 0;

Viewing all articles
Browse latest Browse all 215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>