I'm trying to simulate unscrewing a nut from a bolt. To me, this means tracking the y-rotation and moving the nut on the y-axis depending on the direction the nut is rotating. The problem is that euler angles loop between 0 and 360 and quaternions between -1 and 1. This causes my nut to only be able to move up and down within a single rotation.
I've considered trying to catch the jumps (ie detecting rotation.y jumped from 359 to 1, rotating clockwise) and compensate for them, but there were a lot of edge cases this wasn't good. What's the best way for me to go about this? Any help appreciated, thanks.