Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: saldavonschwartz on July 25, 2014, 09:58:33 PM

Title: Local position transform of objects in NGUI Grid is always 0
Post by: saldavonschwartz on July 25, 2014, 09:58:33 PM
I have a scene where I have a few NGUI UIWidgets laid out inside an NGUI UIGrid. And I notice that once the scene is running and the objects are laid out, even though the inspector shows sensible values for the transform position of each object laid out inside the grid, trying to log the positions thru code always returns a Vector3 with all components set to 0. That is, say, I have a widget inside the grid with position x:-700,y:-180, doing Debug.Log(.transform.localPosition) logs (0.0, 0.0, 0.0).

Any idea what am I doing wrong?
Title: Re: Local position transform of objects in NGUI Grid is always 0
Post by: ArenMook on July 26, 2014, 03:44:01 AM
You are either logging the wrong object (such as position of the UIGrid instead of the child items), or you're doing it before the UIGrid's Start() function, which is where it repositions all children.