Hi to all,
I want gradually rotate my camera from a direction to another one.
I’m using this script but doesn’t work. Camera original rotation (50,0,0) doesn’t reach the desired Rotation (0,45,30)… but changes in (32.9,358.1,4.11). Why? Where is the error?
function Update () {
var rotation = Quaternion.FromToRotation (transform.eulerAngles, new Vector3(0,45,30));
transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * 6);
}