Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question about setting spacing of specific horzontal layout element

Discussion in '2D' started by karlsohelloworld, Jan 20, 2019.

  1. karlsohelloworld

    karlsohelloworld

    Joined:
    Dec 30, 2018
    Posts:
    1
    Hi, I am tring to set the spacing of one element inside the horizontal layout. How can I change the spacing without change the spacing of other elements?

    It seems that I can only modify "HorizontalLayoutGroup.spacing" proprety and it will change all the spacing of elements inside the horizontal layout.

    Are there any good ideas?

    Many thanks.

     

    Attached Files:

  2. Primoz56

    Primoz56

    Joined:
    May 9, 2018
    Posts:
    369
    Try LayoutElement on the object in question. You can also insert an 'empty' object to emulate spacing.