Extremely weird error with rotation.

I want to set an object’s rotation to sth by y axis from a script. but whenever I try to set it to something it goes to 180 and stays there. And it cant be a problem with my scene, because I tried the following:
I made a new project and a new scene. I placed a cube. I made a script which only had the following:

function Update() {
   transform.rotation.y += 1;
}

The cube should start rotating along y axis, shouldn’t it? But what happens is that its rotation will go to 180 immediately and stay there!
What is the matter? Is it a bug from unity3? Are there any solutions?

transform.rotation is a quaternion, not a euler angle.

–Eric

try using this as a guideline : http://unity3d.com/support/documentation/ScriptReference/index.Common_Operations.html

To rotate along Euler Angles, you can use transform.eulerAngles or transform.localEulerAngles. It will give you a Vector3 to manipulate the way you would expect.