How would I rotate a part relative to an offset pivot?

Title basically describes my question. I am having trouble with this, and I would love some help.

This is the best I have. The part is parented to another part that is already rotating and also moving. This was to keep the rotating part’s position aligned.

For example, Part A is the parent, and Part B is the part that I am having issues. Part B is parented to Part A. Part A is constantly moving and spinning, and Part B should also be rotating, but also has to maintain the same distance from Part A while doing so.

while true do
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(10), 0)
	
script.Parent.RotatingPart.CFrame = script.Parent.RotatingPart.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(10))
wait()
end

I think the best option would be to just use a WeldConstraint.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.