How can i fix a position of a gameobject after it meets its condition

when I press a button the object moves down and when I releases the button(Eventrigger Pointer UP) my gameobject moves up . but when it reached
the condition:

if (destPos.y > origPos.y) 
  {
         vInput = 0f;
  }

After this function is called I press the button but it no longer works.
how can i make it work everytime i presses the button and i want to limit that the y position of destPos will not be greater than y axis of origPos. Hope someone can help me with this. Thanks in advance!

void Update()
{	
	if (origPos.x != 0) {
		Debug.Log(destPos.x);
		destPos = origPos;		
	}
	destPos.x = origPos.x;
	origPos = new Vector2 (origin.transform.position.x, origin.transform.position.y);
	destPos = new Vector2 (destination.transform.position.x, destination.transform.position.y);

	if (destPos.y > origPos.y) 
		{
		vInput = 0f;
}

}

void FixedUpdate()
{
	Move(vInput);
}

public void Move(float verticalInput )
{
	Vector2 moveVel = myBody.velocity;
	moveVel.y = verticalInput * speed;
	myBody.velocity = moveVel;
}



public void StartMoving(float verticalinput)
{
	vInput = verticalinput;	
}

}

What if you try this?

if (destPos.y > origPos.y)
{
    destPos = new Vector2 (destPos.x, origPos.y);
}

Typed on my phone, so sorry for typos.

You should use Clamp to restrict the position of any object you want.

destYPosCorrect = Mathf.Clamp(destPos.y, minValue, maxValue)

Then you can use it as a variable of a Vector3, also remember to do it in update if your Y limits are changing within the game. Otherwise just preset min to a public variable , you can check what value to put by using the inspector (though hardcoding is bad practice)