Deactivate Update() Function.

Hi, So I want that when the code reaches this part
_
"if (this.transform.localPosition == targetpos) "
_
stops checking Update() Function, I’m not sure if I should use the Update, but I have no idea, thank you for your help

void Update() {

		if (isLookedAt)
		{
			transform.localPosition = Vector3.SmoothDamp (transform.localPosition, targetpos, ref velocity, smoothTime);
			Debug.Log ("TestInside");

			if (this.transform.localPosition == targetpos) {
		
				Debug.Log("BUTTON HAS BEEN SELECTED!");

Coroutine is more appropriate when dealing with temporary action:

IEnumerator MyCoroutine() {
        while(this.transform.localPosition != targetpos){
              transform.localPosition = Vector3.SmoothDamp (transform.localPosition, targetpos, ref velocity, smoothTime);
               Debug.Log ("TestInside");
               yield return null.
         }
}

There is a chance that the check in the while never returns true because of float inaccuracy. If it is the case, check for a magnitude difference instead.

You could also use Lerp or MoveTowards which seem more appropriate for this purpose.