I have gameobject that rotates (only by y axis) with compass from
Input.compass.trueHeading. For smoothing my rotation I use
Mathf.SmoothDamp() and it works perfect, but only when I’m rotating in clockwise direction. If I rotate my phone in counterclockwise direction and passing 0° (eg. from 12° to 350° in counterclockwise direction) my gameobject start to rotate in clockwise direction until it reach desired degree.
Before that I used
Mathf.SmoothDampAngle() for calculating my rotation, but than I had problem with short-way rotation (when I want to rotate my object from 12° to 350° in clockwise direction it starts to rotate in short-way direction, which is 22° by counterclockwise
So the question is: how I can improve my rotation and rotate my gameobject in specific direction by