Currently working on a windmill. There are two ways I am approaching this, the first method is to declare offset first, when I do this it works perfectly until the windmill moves, the second method is to update the offset as the object spins but this causes the object to slowly accelerate. Here is the code
local joint = Motor6D
local rootPart = joint.Part0
local startTick = tick()
local offset = joint.Part1.CFrame:Inverse()
while true do
local x,y,z = rootPart.CFrame:ToEulerAnglesYXZ()
z = z + (math.rad(1) *(tick()-startTick))
local rootPartNewCFrame = (CFrame.new(rootPart.Position) * CFrame.fromEulerAnglesYXZ(x,y,z))
-- here is the part where I can replace joint.Part1.CFrame:Inverse() with offset. Each of these work differently
joint.C1 = joint.Part1.CFrame:Inverse() * rootPartNewCFrame * joint.C0
RunSerivce.Heartbeat:wait()
end