transform.Rotate question

Maybe it’s just not my day, but this is my code:

transform.Rotate (xRotation, yRotation, 0);

xRotation and yRotation are -Input.gyro.rotationRotate.x/y and my z is supposed to stay 0 but it doesn’t. It changes slightly and messes up my camera rotation in game. I tried commenting this line of code and instead said transform.Rotate (0, 0, 0); and this did absolutely nothing. It didn’t even change any of my rotations and I have no clue why. Like I said maybe I’m just stupid today but this seems weird to me.

I tried transform.rotation = Quaternion.Euler(xRotation, yRotation, 0); but this rotates the camera only slightly as if it’s clamped and trying to do *10 makes it go extremely fast to a certain point and then clamps again… So yeh I’d really like to know why transform.Rotate is acting so weird…

Anyone interested in the solution, here it is:

GameObject camParent;

void Start()
{
   camParent = new GameObject ("camParent");
   camParent.transform.position = transform.position;
   transform.SetParent (camParent.transform);
   Input.gyro.enabled = true;
}

void Update()
{
   camParent.transform.Rotate( 0, -Input.gyro.rotationRateUnbiased.y, 0);
   transform.Rotate (-Input.gyro.rotationRateUnbiased.x, 0, 0);
}


}

If you change the camera settings in the editor however while in Unity Remote 5 it will still drift off for whatever weird reason, so as long as you don’t touch those and just let the gyro do everything you should be fine.