In my android game I have a sphere which you can turn around (360 degrees) with your finger (up and down around the x-axis).
At the front of the sphere there is a button. When you hit the button, the sphere will rotate to a fixed angle, for example 60 degrees up. Thats working fine.
The code for this:
transform.rotation.x = Mathf.Lerp(transform.rotation.x, 0.5, rotateSpeed);
But when I first turn the sphere around for 360 degrees and then push the button, the sphere will rotate 60 degrees down instead of up.
What I would like to have is that the sphere always will rotate up, no matter if it is first turned around for 360 degrees.
Does anybody know what’s going on here?