Object rotation in one way and its comeback to default position

I wanted to make an anti-grav ship which during turning i.e left rotates itself on y-axis in the same time for about 10’ left and gets back to its default y-rotation after horiz-axis button is not pressed, and my problem is that this code i’ve made have an error that i can’t point out myself.

Here’s my error message:
(An instance of type ‘UnityEngine.Rigidbody’ is required to access non static member ‘rotation’)

Here’s the code: (updated)

var speed: float = 300.0;
var y: float = 1;
function Update() {
	horRotation = Input.GetAxis ("Horizontal");
	verMovement = Input.GetAxis("Vertical");
	if (verMovement) {
		rigidbody.AddForce(transform.forward * verMovement * speed);
	}
	if (horRotation){
		transform.Rotate (Vector3 (0,horRotation,0));
		transform.Rotate (Vector3.forward * horRotation);
		transform.rotation.y = Mathf.Clamp (transform.rotation.y, -10, 10);
	}
		}
function LateUpdate () {	
	horRotation = Input.GetAxis ("Horizontal");
	verMovement = Input.GetAxis("Vertical");
	//rotation = transform.gameObject;
	while (Rigidbody.rotation.y > 0 && !horRotation){
		transform.Rotate (Vector3 (0,-y,0));
	}
	while (Rigidbody.rotation.y < 0 && !horRotation){
		transform.Rotate (Vector3 (0,y,0));
	}
		}

This bit:

while (Rigidbody.rotation.y > 0 && !horRotation){
 transform.Rotate (Vector3 (0,-y,0));
 }
 while (Rigidbody.rotation.y < 0 && !horRotation)

The term “Rigidbody” refers to the Class Rigidbody. The static error is because it is looking for the rotation value in the class, not the object. It doesn’t find it and throws an error.

The term “rigidbody” refers to the Component of type rigidbody attached to this object. This is what you are looking for. Just swap out your capitals and it should work.