- Home /
Question by
darman96 · Mar 18, 2016 at 12:23 PM ·
2duirecttransform
Position 2D GameObjects via Code
Hi,
I have a Panel as container which will add other panels as children during runtime. But everytime it adds a new child Panel, the position and size is messed up so how can I make the child panel fill the parent via a script?
I tried accessing the rect of the RectTransform component but it's read only so this didn't work.
Greetings :)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612072048im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Accessing RectTransform Rotation? 1 Answer
Place UI element on pointer up position. 1 Answer
How to copy one Rect Transform data to other Rect Transform 2 Answers
How do I scale the Xmax value of a RectTransform 3 Answers
How to change the Top and Bottom (rect.yMin and yMax) properties of a rectTransform, in a script? 2 Answers