Hi,
I have a reload animation that i want to Slerp slightly, I've tried using Quaternion because I thought it alway taken the shortest route?
I have 2 Quaternion, 1 (3,964, -176.115, 0, 0) and (0,-176.115, 0, 0) but when using Slerp it goes the long way around.
I've tried eulerAngles and localEulerAngles and seem to get the same results.
Here is a snippet of my code.
Any help would be greatly appreciated ..
var _reloadRotation : Quaternion;
private var _transformsRotation : Quaternion;
private var j : float;
function reloadLerpPosition ()
{
_transformsRotation = transform.rotation;
j = 0;
while(j < 1)
{
j += Time.deltaTime/0.6;
j = Mathf.Clamp(j, 0, 1);
transform.rotation = Quaternion.Slerp(_transformsRotation, _reloadRotation, j);
yield;
}
}
↧