- Home /
Question by
csurgod · Apr 07, 2017 at 06:46 AM ·
gameobjectparent transform
Modifying parent game object's size from trigger
Hey,
My goal here is, when a ball reaches a trigger zone, the parent of the TriggerChecker game object's size would increase.
private void IncreaseSize()
{
GetComponentInParent<Transform>().transform.localScale += new Vector3(0, 2f, 0);
}
The current behavior is that the child object, the trigger zone jumps into the center of the gamefield and increase it's size + height.
What should I do different?
Comment
Answer by Cuttlas-U · Apr 07, 2017 at 09:54 AM
Hi; u can simply get the parent object Transform in the trigger checker script by the following :
transform.parent
then u can do what ever u want with that transform ;
Your answer
![](https://koobas.hobune.stream/wayback/20220612114742im_/https://answers.unity.com/themes/thub/images/avi.jpg)