What are Content Fitters and Layout Groups?

Tyler Smallwood
3 min readSep 5, 2023

--

Objective: Cover what Content Fitters and Layout Groups are.

Unity has a few components that help with content that is under UI. Our first one is the Content Fitter. Say for text, you create a new text object it’s typically small. If you add a lot of text into to it, you will need to adjust the width and height of each object. To do this quickly just add a Content fitter onto the text and it’ll adjust accordingly.

With the text selected, Add Component and type in content Fitter.

With the adjustment of text size, you can see Rect bars adjust to keep it around the text.

That’s Content Fitter, now for Vertical Layout Group. If we happen to have multiple text objects that we wanted to be in the same group but separated a little, we can use Vertical Layout Group to have it space everything out smoothly. In the Gif below we can see the three text objects.

All three text objects will need to be a child of another object.

On the Parent object, we will add the vertical layout group component.

There are a few options under Vertical Layout Group. For more information we can refer to the documentation.

For this article, I used Spacing. Spacing gives space between each object.

This helps with a lot of UI options, can be used with Buttons, Icons, and pictures as well.

Thank you for reading and have a wonderful day!

--

--

Tyler Smallwood
Tyler Smallwood

Written by Tyler Smallwood

I am passonate on learning to program and use Unity to become a skillful Unity Developer

No responses yet