Hi all.
I have a simple question. I try to use this code:
float correctRotation = 240;
Vector3 currentRotation = transform.eulerAngles;
currentRotation.y = Mathf.Lerp(currentRotation.y, correctRotation, Time.deltaTime * 5f);
transform.eulerAngles = currentRotation;
Function perfects but if I stop in position where my object.y rotation is 120 for example, and I want to go to 240 in anticlockwise, this need rotate to 0 and 360 to 240.
With my code the rotation go directly to 240 in clockwise rotation. The shortway…But I cant the shortway…
How can I make it?
Thanks