- Home /
how do I scale my Instanciated GameObject to a parent gameObject that varies in scale?
I have a Mother game object, which has a group of Child game objects.Each Child game object spawns a ball through Instanciation.
In my game, the player is able to scale Mother (which in turn, scales all the Child objects).
However, whenever the Child spawns the ball, the ball's scale isn't to the child. It either ends up being too small when Mother is scaled up, or too big when Mother is scaled down.
The ball itself is a prefab. How can i make it scale so that it'll be the same size as the child?
to have an idea, because child's parent is Mother and when the player scales the Mother, only the Mother's scale changes (the child's scale is still 1)
Answer by Mrpxl · Jun 09, 2021 at 09:13 AM
I would recommend you change a bit your "Mother" hierarchy so that you have something similar:
MotherRoot // The parent that moves
BallParent //A child object of MotherRoot that is the parent of your balls prefabs
MotherScaleRoot // A child object of MotherRoot that will be the object you scale
Your answer
Follow this Question
Related Questions
Having trouble instantiating a gameobject with rotation 0 Answers
Instantiating Cube Prefabs with scale 3 Answers
How to access an instantiated game object using c# ? 1 Answer
Instantiate object as child of exsisitng game object 1 Answer
Can the insides of a gameObject affect its transform? 0 Answers