#I want the this ui to extend only downwards with the amount of grid objects (content size fitter)
1 messages · Page 1 of 1 (latest)
Your anchors of your rect are set to extend to the height of its parent. you might want to anchor them top and then let the size only grow downwards
like this? because it didnt change
Never been a big fan of grid layout group. I would have used horizontal layout group with two playername buttons and make them a child of a vertical layout group. But maybe grid layout can achieve that too nowadays
anchors make my smooth brain hurt
What are you actuallyt rying to do right now with the content size fitter?
the panel is a child of playersmenu do u mean that?
i want the black transparent background (panel (1)) to extend downwards with the amount of playernames in it
Ah, got it. You can just make it a child of your grid layout group and use the LayoutElement component to ignore the layout and stretch over full width and height
alright that makes sense ill try that
Basically something like this
i think i understand what you mean with scaling the bg but that still leaves the problem of the grid layout with the content size fitter extending up and down from its middle point is there a way where i dont need to use content size fitter maybe?
Thats why I was asking about what you want to achieve. It should not extend to top, if you set the anchors correctly
For me, this results in correct top anchored sizing to bottom:
Ah, your pivot is the issue. its y is set to middle, not 1 (top)
oh my god that was it 🤦♂️
that was my entire isssue haha
thanks a lot for helping i normally avoid unitys ui system for a reason i mess up easily lol
works great now 👍