- Home /
How do I scale a 2nd level child in transform hierachy.
Let say I have a root object. Inside root contains another child object. Inside child object contains another grandChild object.
ex: Root -> Child -> GrandChild
But when I do scaling on root object in script, it only affects the child but not grandChild. I wonder how can I achieve the effect of whenever I apply different scaling values on root, it will change the child and grandChild objects too.
Answer by birdkingz · Sep 13, 2011 at 06:44 AM
sorry, I just noticed is my careless mistake. Cause I forgot to set my childs initial scaling value to 1.
Answer by birdkingz · Sep 13, 2011 at 06:38 AM
I just noticed that not only Grandchild object, even my Child object didn't get affected while I'm scaling the root object.
this is what I write in the Root component script:
gameObject.transform.localScale = newScale;
Your answer
![](https://koobas.hobune.stream/wayback/20220612211755im_/https://answers.unity.com/themes/thub/images/avi.jpg)