Not understanding the workflow

Hello,
I have been messing with the older Unity workflow for UI elements (not the new preview system) and I can not understand how or why some of these things are happening.

For example,
I have a scroll rect, and under that a viewport, and under that a content object, like the documentation suggests.

7456637--915092--upload_2021-8-28_16-13-12.png

scroll rect - width controlled by parent layout group (330)
viewport - set to “stretch”
content - set to “stretch”

Then I put a vertical layout component on my content div, and set the vertical layout to control the child width and force expand the width. So you would think… the result would be 330 right? since the parent is 330, and were set to stretch…

However the result is 373… and I can not for the life of me figure out why.

I’ve tried all different combos of layout elements, content size fitters and prefered vs min settings… but for whatever reason, stretch on something thats 330… makes it think its child needs to be 337 and bleed outside of the viewport…

Anyone know whats going on here?
Thanks

I have no idea where this thing thinks its getting its numbers from

Seems like Unitys scroll rect is making the “viewport” somehow smaller despite it being set to stretch

You might have better luck in the UGUI forums. This is the UIToolkit forum. :frowning:

My bad. Thanks, I thought UiToolkit meant “all the ui components/tools unitys given us for ui”

1 Like

UI Toolkit is an entirely new UI system:

Here’s a comparison chart: Unity - Manual: Comparison of UI systems in Unity

.

ahh so toolkit is the new web-like ui solution they rolled out. Thanks, didnt know the name

Hmm yeah I wish there was an admin I could @ to move this thread ><

It was previously called UIElements - does that ring a bell? :slight_smile:

If not, no worries - now you know :smile: