I am using SteamVR and would like to rotate the camera based on the height that a controller has been raised, I have written the script that sends the the height of the controller through to a method on my camera script.
When I do the following, the rotation works:
transform.Rotate(0, 0, 30); // 30 is just to test, we will use the controller height later
But I would like to do this rotation slowly, this must not happen immediately.
I have also tried using Quaternion.Lerp, but it does not seem to be working.
Quaternion.Lerp(this.transform.rotation, new Quaternion(this.transform.rotation.eulerAngles.x, this.transform.rotation.eulerAngles.y, zPosition, 0), Time.deltaTime * 5);
Any suggestions?