I want to Lerp an object to a different rotation, but when I set any of the target rotation values to a negative, it acts funny like this: [Lerping Issue - YouTube] When I set the value to a positive it works perfectly fine. My code:
void Update() {
if (one == true) {
transform.localEulerAngles = Vector3.Lerp(transform.localEulerAngles, new Vector3(0, -90, 0), turnSpeed);
}
}
,I want to make a patrolling system where the character rotates from point A to point B using Lerping, but for some reason, when I set one of the Vector3 values to a negative, it goes like this:
[Lerping Issue - YouTube]
When I set the value to a positive number, it works as intended. My code:
transform.localEulerAngles = Vector3.Lerp(transform.localEulerAngles, new Vector3(0, -90, 0), turnSpeed);