When I rotate around Vector3.right everything works.
float angle = 0;
Quaternion rotation = Quaternion.identity;
void Update()
{
angle += Input.GetAxis("Mouse X") * Mathf.Rad2Deg;
rotation = Quaternion.AngleAxis(angle, Vector3.right);
rotation *= Quaternion.AngleAxis(Time.time*Mathf.Rad2Deg, Vector3.up);
transform.rotation = rotation;
}
But when I replace Vector3.right with transform.right the rotation works for a couple of sec and than starts to rotate in all directions very fast.
float angle = 0;
Quaternion rotation = Quaternion.identity;
void Update()
{
angle += Input.GetAxis("Mouse X") * Mathf.Rad2Deg;
rotation = Quaternion.AngleAxis(angle, transform.right);
rotation *= Quaternion.AngleAxis(Time.time*Mathf.Rad2Deg, Vector3.up);
transform.rotation = rotation;
}
Also the object should first rotate around transform.right and then around local up. But instead it rotates around global up.
Why this happens ?