How do I multiple objects orbit a brick evenly? So, if there are two satellites, they are on opposite sides. If three satellites, space between them is a third. All automatically.
You need to figure out how much to rotate each part in orbit, initially. Once they are placed you may continue to rotate each simultaneously.
A circle has 360ยบ. The quotient of 360 and the number of parts is going to be the summand that will rotate each part in even relation to one another..
360/2 = 60
360/3 = 120
You may use a for loop to easily implement this into the step syntax;
for [variable] = [start],[finish],[step] do
--code
end
Here is an example ;
local reference = workspace.Part; --Part to orbit local ps = 3; --Number of parts to orbit local offset = 1; --Offset from the reference for i = 1,360,360/ps do --Implement summand into step local orig = reference.CFrame; local rot = CFrame.Angles(0,math.rad(i),0); --Assuming this is your axis local dist = CFrame.new(0,0,-offset); local p = Instance.new("Part"); p.CFrame = orig*rot*dist; p.Size = Vector3.new(1,1,1); p.Anchored = true; p.Parent = workspace; end