Iam trying to smoothly rotate a gameobject to face a position but Quaternion.LookRotation is returning some weird values that don’t seem to match the rotations.
The eulerangle rotation seems to jump between (somerotation here, 270, 90) and (somerotation here, 90, 270). It doesn’t make any sense to me at all. I tried different upwards vectors but this doesn’t seem to make sense either. All I want is to smoothly rotate a object in 2D so this should be easy.
var rotateDirection = Quaternion.LookRotation(TargetPositionSource2D.TargetPosition.Value - (Vector2)transform.position, Vector3.back);
transform.rotation = Quaternion.RotateTowards(transform.rotation, rotateDirection, 5 * Time.deltaTime);