As most of you may know, the UiAspectRatioConstraint resizes a GUI element to keep a specific aspect ratio. However, I have found a situation where it is not behaving like that.
My AspectType is ScaleWithParentSize and the dominant axis is the width. The GUI elements position and scale are based on the screen scale so it resizes accordingly. For narrower screens, it behaves as expected. However, after reaching a certain screen width, the GUI element continues to change its position respective to the screen but the scale no longer changes.
Although in this situation that may look good, it messes things up once I start to program my own slider. In order to find where the mouse is relative to the slider, I need to know the position of the beginning of the slider. Since the size and position are based on screen size, I need to use those and do the math. However, once the object stops scaling in size, these numbers become inaccurate resulting in the slider also becoming inaccurate.
My question is, how can I get the GUI element to continue to scale so these numbers are accurate or alternatively, does anyone know another way of making sliders that wouldn’t suffer from the same issue?
Thanks.