Search Unity

sizeDelta returning (0, 0) in 5.3.2

Discussion in 'UGUI & TextMesh Pro' started by smitchell, Mar 1, 2016.

  1. smitchell

    smitchell

    Joined:
    Mar 12, 2012
    Posts:
    702
    Hey,

    I'm having a weird issue in 5.3.2, when I get a RectTranform' sizeDelta it return (0, 0) in 5.2.0 it returned the correct size.

    Any ideas why? The code hasn't changed.

    Has anything changed between unity builds that could be the issue?

    Cheers.
     
  2. smitchell

    smitchell

    Joined:
    Mar 12, 2012
    Posts:
    702
    never mind,
    figured out a work around..

    So getting the size in Awake () doesn't work anymore, but getting it from Start () does.
     
  3. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    According to Unity,

    So I believe you might get valid data when querying the RectTransform in Start or other functions later in the update cycle provided there are no Layout components affecting this RectTransform otherwise, you'll need to wait until the end of the frame to get valid data.