Circular Gui issues?

Attempting to create a circular Gui that generates in a Clock-wise rotation;
_1 _2

As you can see from the images above, they are not level.
Does anyone have any suggestions?

local ScreenGui = script.Parent
local Main = ScreenGui:WaitForChild("Main")
local Pivot = script:WaitForChild("Pivot")

local Num = 8; local Val = 25
local Rotation = 0

--||--||--||--

local Pos = Val * Num

--||--||--||--

for i = 1,Num do
	local New_Pivot = Pivot:Clone()
	New_Pivot.Parent = Main
	New_Pivot.Rotation = Rotation
	New_Pivot.Name = tostring(i)

	New_Pivot["Frame"].Position = UDim2.new(0, 0, 0, -Pos)

	Rotation = Rotation + 360 / Num
	New_Pivot["Frame"].Rotation = New_Pivot["Frame"].Rotation - New_Pivot.Rotation
end

Use math.sin or math.cos, cosine is the X coordinate and sine is the Y coordinate.

1 Like

Can you elaborate on this please?

They are trigonometry functions. You can use them to determine where the frame will be positioned

If I want the frame to be positioned at 40 degrees from the center and 70 away, I would do this

local inRad = math.rad(40) -- since math.sin and math.cos use radians

local x = math.cos(inRad) * 70
local y = math.sin(inRad) * 70
local result = UDim2.new(0, x, 0, y)
3 Likes