I have a part moving, and for some reason it gradually moves diagonally. The part is anchored and cancollide true. This is a server script inside the part.
wait(3) local part = script.Parent while true do wait(0.01) part.CFrame = part.CFrame * CFrame.new(-Vector3.new(0,0,6)) end
What are you trying to do with the script? If you're just trying to set it at a certain CFrame, you would want to do
part. CFrame = CFrame.new(x,y,z)
If you want to rotate it, I think you would want to do
part.CFrame = part.CFrame * Cframe.Angles(x,y,z).
I think when you're multiplying by CFrame.new(Vector3.new(x,y,z), you're moving the part from its current CFrame to the Vector3, a position in the Workspace, which is why it is gradually moving diagonally. Even if it is Anchored and cancollided, the script will still move it to its new position.
So when multiplying CFrames, the rotation properties of both can interfere with direction. To make the object move in a direction globally, multiply the position with the CFrame you want.
local part = script.Parent while wait() do part.CFrame = CFrame.new(part.Position)*CFrame.new(0,0,-6) end
Let me know if that works for you.
Good Luck!