Transform.rotate with small angles jumps from 180 to 90
I have an object which I am rotating each frame around a point named 'RotatePoint' by an Angle named 'RotateAngle'. The RotateAngle is defined by the angle between two points so varies each frame but is very small, somewhere in the region of -0.2 to 0.2 degrees.
Object.transform.RotateAround(RotatePoint, Vector3.up, RotateAngle)
This command works fine for a 180 degree sweep, however rotating beyond a certain point the object's rotation will jump by 180 degrees back to the start of this sweep: i.e when the rotation exceeds 270 degrees it jumps to 90 and vice-versa.
Even more strange, these jump angles vary, sometimes they could be 60 and 240 or sometimes 100 and 280 for example.
I think it may have something to do with quaternians (which I do not currently understand beyond basic level) but I have no idea why this is doing this, or how to stop it. Does anyone know why?
Your answer
Follow this Question
Related Questions
Get object's rotation around axis defined by vector 2 Answers
How to get Quaternion from Transition Matrix 0 Answers
Rotation Issues with compass markers not positioned correctly 0 Answers
Euler Angles in code / inspector different (both local & global) 1 Answer
Child object looktowards waypoint 0 Answers