Changed this line in both functions:
float rotationAngle = Mathf.Rad2Deg * Mathf.Atan2(currentAcc.y, currentAcc.x);
with
float rotationAngle = Mathf.Rad2Deg * Mathf.Atan2(currentAcc.y, Mathf.Abs(currentAcc.x));
↧