print('WELDINGGGGG USING MOTOR6D')
local part = script.Parent.yTest
local part2 = script.Parent.xTest
local a = Instance.new('Motor6D')
a.Parent = part
a.Part0 = part2
a.Part1 = part
while true do
wait()
a.C0 = a.C0 * CFrame.Angles(0,math.rad(5),0)
end
yTest is the part that is going to rotate. xTest is the part that is the “base”. I switched the Part0 and Part1, but the results are the exact same as previous.
I have found a solution, you can add a ‘SpecialMesh’ to the ‘xTest’ Part and change the ‘MeshType’ to brick alongside with changing the ‘y Offset’ of the ‘SpecialMesh’ to something close to 5.
Yes, but I’d like to keep the base still. Imagine the base is a tank, and the part I’m trying to rotate is the turret. That’s what I’m trying to do, so I can’t move the base.
Solved it. Turns out I have to set the C0/C1 values first. Here’s the working code.
print('WELDINGGGGG USING MOTOR6D')
local part = script.Parent.yTest
local part2 = script.Parent.xTest
local a = Instance.new('Motor6D')
a.Parent = part
a.C0 = part2.CFrame:Inverse() * part.CFrame
a.Part0 = part2
a.Part1 = part
while true do
wait()
a.C0 = a.C0 * CFrame.Angles(0,math.rad(5),0)
end