So basically I'm trying to use a motor object to smoothly rotate a tank barrel rather than using a weld and constantly using loops to smoothly rotate, but for some reason, when I move the mouse to rotate the barrel, the barrel rotates in steps rather than smoothly. As in, it'll smoothly rotate to 1 position, then I have to move my mouse a certain distance before it rotates again. I did debugging and the angle that I want the DesiredAngle to be is updating properly, the only problem is that the DesiredAngle itself is staying at a certain angle until I move the mouse a certain amount of degrees from the center. Is there any explanation to why this happens or any ways to fix this problem? Thanks.
Here's the code by the way:
--Pos is the mouse hit position
local XCF = XMotor.Part1.CFrame:toObjectSpace(CF(XMotor.Part1.Position, Pos))
local XAng, _ = getAnglesYX(XCF)
XMotor.DesiredAngle = XAng
print(XAng, XMotor.DesiredAngle)
Also here's a gif of what's going on for better understanding

2 comments
@TurboFusion What is 'Pos'?
@DigitalVeer I updated the question