how can compute two values of the angle of Quaternion (StartAngle,EndAngle) between angle( also angle of Quaternion )?
This is my previous code:
public Vector3 My_Rotation01 = new Vector3(0f,180f,0f); //save target angle
public Vector3 StartAngle; //will save current angle
void Start () {
StartAngle = transform.rotation.eulerAngles;//// saveing current angle
}
void Update () {
transform.rotation = transform.rotation * Quaternion.Euler((My_Rotation01 - StartAngle) * Time.deltaTime);
}
but,This would often calculation error:
e.g. “0° → 20°” will become “0° → 340°”
So, I would like know there a better way?
Thank all
![]()