UIGridLayout mixed with UIAspectRatioConstraint can cause extremely strange values

Hey all!

In a UI structure, using a UIGridLayout where the size value in that object is set to UDim2(n>0, 0, 0, 0) (Any case where a size value will cause 0 size on only one axis, this also applies if the X axis is 0 and Y>0) will cause UI object position to be extremely offset if you use a UIAspectRatioConstraint to govern the size of the objects in the grid layout. For instance, in the UIGridLayout, I set my X size to 0.125 on scale but left all other values at 0. I used a UIAspectRatioConstraint to create a 1:1 aspect ratio for each frame inside of the grid. This was the result.

This is only notable when the UIGridLayout has its alignment point for horizontal alignment not set to Left and/or its vertical alignment not set to Top

image

3 Likes

I noticed the same thing when trying to make a menu scale properly at different resolutions. The positions had extremely large numbers, and I think the scaling wouldn’t work properly either.

1 Like