I'm working on something that involves two bricks. If one of the bricks rotate, then the other brick needs to stay the same distance away but rotate around it at the same time. Is there any way to script that?
If you want to preserve the relative orientation of another part to one that is rotating, then take two parts a
and b
; a is rotating. Get the new CFrame for a:
local new=a.CFrame*CFrame.Angles(0,math.pi/8,0)
set b's new CFrame relative to the change in a's CFrame:
b.CFrame=new*a.CFrame:inverse()*b.CFrame
set a's CFrame
a.CFrame=new