trying to make an object move up and stop via trigger

so far I’ve been able to make it go up but can’t make it stop after that(it just keeps going up)

using UnityEngine;
using System.Collections;

public class rise_trigger : MonoBehaviour {
	public GameObject stair1;
	bool risertrig=false;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
		if(risertrig == true){
			stair1.rigidbody.velocity=transform.TransformDirection (Vector3.up * 2 );

		}

		if (risertrig == true) {
						if (stair1.transform.position.y == 362) {
								risertrig = false;
						}
				}

	}

	void OnTriggerEnter(Collider other){
		if (risertrig == false) {
			risertrig = true;
				}
	}

}

Any help would be much appreciated

I suppose that the position of the stair1 GameObject will never be EXACTLY 362. Try doing this instead.

if (risertrig == true) {
                 if (stair1.transform.position.y >= 362) {
                    risertrig = false;
                 }
          }