Search Unity

HorizontalLayoutGroup.preferredWidth does not return width of children??

Discussion in 'Scripting' started by JohnSonLi, Dec 18, 2018.

  1. JohnSonLi

    JohnSonLi

    Joined:
    Apr 15, 2012
    Posts:
    586
    It has 16 child objects and in the debug preview its "Total Preferred Size" is 729, But When I access its "preferredWidth" in script, it is 0.
    So "Total Preferred Size" == "preferredWidth"??