Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Get current world position of an element in a layout group?

Discussion in 'UGUI & TextMesh Pro' started by afoutsjr, Feb 21, 2015.

  1. afoutsjr

    afoutsjr

    Joined:
    Aug 15, 2012
    Posts:
    7
    The following code is only returning the original position of the element, not the current position as arranged by the layout group:

    contentHolder.transform.GetChild(0).transform.position;

    What am I missing?
     
  2. afoutsjr

    afoutsjr

    Joined:
    Aug 15, 2012
    Posts:
    7
    Issue resolved. I was attempting to get the position of the element immediately following dynamically adding the element to the layout group. Used "WaitForEndOfFrame" to make sure the element was rendered before attempting to get the position of element.
     
    naturalbornlazy and anisimovdev like this.