Alright so I am making a game where I have the player choose how many teams from 1 to 10. the problem is the flag bases need to spawn equidistant from the center and the one next to it, I will show what I mean. https://gyazo.com/e2c299755bc98427ccdd6827c01ceac9
This would be for three teams
Basically all the parts are the same distance from the part next to it and are all the same distance from the center. As my boundary I am using a circle, if you think is a square is better tell me. Thank you for your help, if you think this is bad please propose an other suggestion for doing something like this.
And even after I solve this I have an other problem of these bases spawning on other map parts I also need help to solve that.
local count = 3
local size = 1
local off = 1.2
local dis = math.pi*2*size/count
local pos = CFrame.new(0,2,0)
function gen(t)
local o = Instance.new('Part')
o.Name = 'Point'
o.Anchored = true
o.Size = Vector3.new(1,1,1)
o.Shape = t
return o
end
for i=0,count-1 do
local cf = pos*CFrame.Angles(0,dis*i,0)*CFrame.new(0,0,-size*off)
local o = gen(Enum.PartType.Block)
o.CFrame = cf
o.Parent = workspace
end
gen() just generates the part. You can replace that with whatever. off is the offset, uh… Count is the number of things. Anyway, I’m sure you can figure out the details.