Hi, I’m using a motor to rotate a ring, and some strange behaviour I’ve noticed, is that lets say the motor’s current angle is arbitrarily at say 4 radians. If I then want to change the desired angle to then be only a tiny amount away from 4, such as 4.145, the desired angle will refuse to update, no matter whether I set it via Motor.DesiredAngle = 4.145
or
Motor:SetDesiredAngle(4.145)
The motor seems to happily accept new desired angles sufficiently larger than the current set angle.
Here is my relevant code in-case there may be a slip-up I haven’t seen, causing this behaviour:
if priv.dialDir == 1 and dir == 1 then
rotateAngle = Motor.CurrentAngle + (2 * math.pi - angle)
print("Right and Clockwise")
print("Angle: "..tostring(rotateAngle))
elseif priv.dialDir == 1 and dir == -1 then
rotateAngle = Motor.CurrentAngle + angle
print("Left and Clockwise")
print("Angle: "..tostring(rotateAngle))
elseif priv.dialDir == -1 and dir == 1 then
rotateAngle = Motor.CurrentAngle - angle
print("Right and AntiClockwise")
print("Angle: "..tostring(rotateAngle))
elseif priv.dialDir == -1 and dir == -1 then
rotateAngle = Motor.CurrentAngle -(2 * math.pi - angle)
print("Left and AntiClockwise")
print("Angle: "..tostring(rotateAngle))
end
Motor.DesiredAngle = rotateAngle
repeat
wait()
until Motor.CurrentAngle == Motor.DesiredAngle or (not priv.universeActive)
Anyone experienced this sort of small angle change behaviour?
Thanks