Search Unity

How to get the start RectTransform position in Start method from another RectTransform?

Discussion in 'Scripting' started by angelfcm, Feb 6, 2016.

  1. angelfcm

    angelfcm

    Joined:
    Jan 24, 2016
    Posts:
    1
    Hi, I am trying to get the start position of the children inside an UI panel but when I run the scene, sometimes I get the correct position but other times I get (0,0,0) or another bad values.

    I know this happens due to a UI element needs to be rendered and after the Start method is called and when I am trying to get the position in Start method from another transform I might get a bad value.

    I would like to know if there is a way to know when a RectTransform has finished of rendered in the screen or if there is another way.

    Thank you!