- Home /
How can i get RectTransform width to set it to my GridLayoutGroup's Cell Size X?
how to get RectTransform width properties and set it to cell size X if my hierarchy looks like below picture?
here's RectTransform anchors presets of the objects. [Panel - Content] Anchors min(0,1), max(1,1) [Panel - Scroll] Anchors min(0,0), max(1,1)
I've tried the following - UIPanelRectTransform.rect.width
but it gives me -10 - UIPanelRectTransform.rect.x
gives me 5 - UIPanelRectTransform.sizeDelta.x
it gives me 10
what i'm trying to do is to set UIPanel's GridLayout CellSize X that is equal to UIPanel's RectTransform Width, how can i get it? please help me
thank you.
Your answer

Follow this Question
Related Questions
Failed to convert sprite texture type in unity UI 0 Answers
When loading into a new scene my UI doesn't work anymore? 3 Answers
Loading a scene after a random amount of time. 1 Answer
Need help with creating UI Text 1 Answer
the new UI system: scrollrect can not scroll when it's content have a PointerDown event 2 Answers