UI in Unity: Layout Groups

Zac Bogner
2 min readMar 12, 2024

In the recent UI in Unity article, we created a math user interface to login to our player profile.

This article will feature Layout Groups:

  • Horizontal Layout Group
  • Vertical Layout Group
  • Grid Layout Group

These layout groups are useful for positioning UI elements, creating mini-games, and allow main menu constructions to be seamless in presentation.

We will start with a Horizontal Layout Group, where we make an empty GameObject and call it Horizontal. adding our Horizontal Layout Group component.

Next, we add our images or prefabs to the Horizontal game object and adjust the properties in the inspector.

For the Vertical Layout Group, we will make another empty game object and add the Vertical Layout Group component.

For this example, we can copy the previous objects and paste into the parent Vertical game object.

And finally, for the Grid Layout Group, we can add another empty game object and add the Grid Layout Group component.

Below we can copy the images again, and child them into the parent object of Grid.

And that’s the basis of Layout Groups in Unity. We can expand upon it in multiple ways, creating a modular UI system to use in future projects.

--

--

Zac Bogner

Game Designer and Level Designer, formerly with Rainbow Studios. Focused in Unreal Engine with experience in Unity. Former Race Car Driver.