So i have a turret that i want to point towards a certain target (for now, my mouse), and i got it working by simply doing this:
pitchObject.LookAt(target); pitchObject.Rotate(new Vector3(-90, 90, 0));
This is the result: 1
Now, the problem is that i don’t want to have to apply it to the turret directly, i want to have it in a quaternion so that i can use Quaternion.Lerp(), so i tried this:
Vector3 direction = target - transform.position; Quaternion quat = Quaternion.LookRotation(direction); quat *= Quaternion.Euler(-90, 90, 0); pitchObject.rotation = quat;
But then suddenly it can no longer look down, as seen here.
Would someone be able to explain to me why this happens? And maybe if i’m doing something else wrong.