I’m trying to create a Circle of which each ring going outwards from the centre has a random amount of parts in which still maintaining it’s shape.
I’ve attached a short video of how it currently works.
So upon generation of the attachment, it’ll get a Number between 1 & 5 - If the Number is 3 then it wil generate said beams / attachments shown below.
I’ve opted to use a circle motion as it keeps everything in a linear pattern & wish to continue using it.
Does anyone have any suggestions?
local isRandom = math.random(1, 5)
if isRandom == 3 then
local Origin = Vector3.new(0, 0, 0)
local AT0 = Instance.new("Attachment", Jupiter3["Base"])
AT0.Name = "AT0"
--AT0.Visible = true
local AT1 = Instance.new("Attachment", Jupiter3["Base"])
AT1.Name = "AT1"
-- AT1.Visible = true
local Beam_Clone = script:WaitForChild("Beam"):Clone()
Beam_Clone.Parent = Jupiter3["Base"]
Beam_Clone.Attachment0 = AT0
Beam_Clone.Attachment1 = AT1
local v1 = Num * ((math.pi * 2) / Parts)
local X, Y, Z
X = Radius * math.sin(v1)
Y = Radius * math.cos(v1)
Z = Offset
local v2 = Vector3.new(X, Y, Z)
AT0.Position = Origin + v2 - Vector3.new(0, 0, 200)
AT1.Position = Origin + v2 - Vector3.new(0, 0, 200)
end