How to arrange UI objects in the form of a fan?

Hey forumites, I ran into a problem while doing this thing, for some reason it always came out uneven for me.
What I had to do: UI elements should be fan-shaped.
What is given: a table with UI elements that need to be arranged according to the condition.

local elements: {GuiObject} = {...}

Here is an example of what it should look like:
1


2

In example 1, there are 3 objects, so 1 of them is in the middle.
In the second, there are 4 of them, so there are 2 of them in the middle.

Any suggestions are greatly appreciated!
Thanks for the help!

1 Like