How to Unity

Unity’s Horizontal, Vertical and Grid Layout Group Explained

What are and how to use the Layout Groups in Unity

Daniele Quero, PhD
Nerd For Tech
Published in
4 min readMay 17, 2024

--

A Horizontal (Vertical) Layout Group in Unity is a component used for arranging UI elements horizontally (vertically). It’s handy for creating menus and toolbars or keeping UI elements tidy and equally spaced.

To use the Horizontal (Vertical) Layout Group, add the component to a gameobject, then place the UI elements inside as children. Let’s now go deep into the properties, which apply to both Horizontal Layout Group and Vertical Layout Group

Padding

The padding is the space between the edges of the layout group and the closest items. It defines an invisible border around the group's layout elements or represents the distance between the first (left, top padding) or last (right, bottom padding) elements and the edges.

--

--

Daniele Quero, PhD
Nerd For Tech

A professional developer with passion for game developing and skill-growing. A former Nuclear Physics Researcher who changed his life to pursue his dreams