Quaternion, eulerAngles, localEulerAngles Driving me mad

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;
	}
}

That’s because rotation is presented in Quaternions which cannot be converted into euler angles with 100% precision. The problem occurs when you cross the 0 point on the x axis (afair).
Try using Rotate() or RotateAround(). It’s generally a good advice to avoid manipulating Quaternions directly. If that doesn’t work: where, how and by what is your method being called?