Automatic Button Positioning

I’ve been making a ‘Forsaken’ styled roblox game, and I’ve had an issue where my interaction buttons just look weird and not centered. I’ve compared my button layouts to Forsaken’s layout, and I’ve found that they used an automatic positioning system. I would be very grateful if I could get some snippets of scripts to help me understand.

Screenshots:

Current Button Layout:

Wanted Button Layout (few examples of different amount of buttons):


Help would be very appreciated.

Not entirely sure what you mean by automatic positioning but have you checked on the screen gui that IgnoreGuiInset is on, when it’s off it can mess with where your element are on the screen

What I mean by ‘automatic positioning,’ is: Based on the amount of buttons visible (excluding sprint and possibly shiftlock), the button will automatically move to basically ‘center’ the buttons. For example, the first image in ‘Wanted Layout’ shows 3 buttons. These 3 buttons are automatically placed based on the amount of buttons. The second image shows 2 buttons which are also placed. If you compare them both, you will notice that the buttons are placed in different locations because of the amount of buttons.

Ah alright I see, I think the easiest way would just be to make multiple screen guis for each scenario (by scenario I mean situation in which there would be a different button layout) and then manually set the button positions for that scenario. And then when you need a different button layout, you hide the current screen gui and just show the one you need. You could also probably do something with averages with scripts but I would recommend just making multiple screen guis if there aren’t too many combinations of buttons

Currently, there are 5 buttons that could be in play, but what if there were more than that. Would I have to use a script to automatically position them?