How to get children transform positions, which with a Grid Layout Group parent?

I have a GameObject in this hierachy order:

-Parent (with Grid Layout Group)

–Child0

–Child1

–Child2

I wanna get the transform positions of each child. But it only return a SAME positions for 3 children.

How can i get their positions ?

Thanks!

Hi there not sure if you are still looking for an answer, but I made a workaround for this.

What I did was, that once the grid layout had positionated the elements in the correct position, I turned off the grid layout and adjusted all the anchors of the children to the corners of each children, eliminating with this all values in their offsets. Once my objects have the anchors in these new positions I ask for the position with:

transform.position

I used this script to adjust the anchors : Adjust RectTransform Anchors for Unity UI · GitHub

Hope it helps you.

I came cross the same problem, my solution:

my workaround: create a child gameObject for each of your childobjects.

-Parent (with Grid Layout Group)
--Child0
---Childchild0
--Child1
---Childchild1
--Child2
---Childchild2

Detach the children, like Child0.DetachChildren(), and now you can access the position of Childchild0 that is the same like Child0