I'm trying to rotate the first person controller's camera on its X axis to look up or down to see a specified object. The look needs to happen over a second or 2.
I found this code in the old first person shooter tutorial:
// Rotate towards target
var targetPoint = target.position;
var targetRotation = Quaternion.LookRotation (targetPoint - transform.position, Vector3.up);
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * 2.0);
How can I get just the x axis rotation from the quaternion so I can have a nice smooth transition?
thanks for any help you can provide!