Trying to open a door so far then stop

Trying to open a door from closed to 90 degrees open and then stop.

I can rotate the object but it keeps going around in 360, I need it to stop.

Have below but just gives errors and Im not sure where I am going wrong.

using UnityEngine;
using System.Collections;

public class opendoor : MonoBehaviour {

public int rotatespeed=40;
public float i=0;
Vector3 objpos = new Vector3 (0,i,0);	

// Use this for initialization
void Start () {


// Update is called once per frame
void Update () {
	if(objpos >= Vector3(0,-90,0)) 
					transform.Rotate (Vector3.down * Time.deltaTime * rotatespeed);

	else 	{



You could possibly make use of the animation system instead of programming it, you can then just play the animation whenever it is needed, instead of coding it yourself, its a lot easier.