Hey,
Having read your last comment, I believe I understand what you want now.
Try using [Quaternion.Lerp][1]:
float maxRot = 45.0f; //Max neg and pos strafe rotation value
float rate = 2.0f; //Rate of change for Lerp
mainCam.transform.rotation = Quaternion.Lerp(mainCam.transform.rotation, Quaternion.Euler(axis * maxRot, mainCam.transform.rotation.y, mainCam.transform.rotation.z), Time.deltaTime * rate);
Hopefully that should work. Haven't tested though. :)
Klep
[1]: http://docs.unity3d.com/Documentation/ScriptReference/Quaternion.Lerp.html
↧