how do I tell when a object gets to a certain spot

I’m making a building thing that makes stuff and I need it to know when a object gets to a certain spot.

var waitTime = 5;
var Builders : GameObject[];
var col : boolean = false;
var start : boolean = true;
var prefab : Transform;
var called : boolean = false;



function Update () 
{
      //trying to tell when it is there then stop it and spawn a object 
	if(Builders[0].transform.position == Vector3(-2, 0, 0))
	{
		col = true;
	}
	
	if(col == false && start == true)
	{
		Builders[0].transform.Translate(Vector3.forward * Time.deltaTime / waitTime);
			if(called == false)
			{
				Build();
				called = true;
			}
	}
	
if(col == true)
	{	
	
	Instantiate (prefab, Vector3(8, 0, 0), Quaternion.identity);
	}
 }


function Build()
{
     //trying to make it wait until it gets there 
	while(col == false){
	yield;
	}
	col = true;
	called = false;
}

thanks in advance :clubs:

If you know what spot the object is going to go to, which in this case -2,0,0, and plan on moving linearly, which you are, I would interpolate the vector instead of translating it. All you would need is Builders[0].transform.interpolate(TargetVector * Time.deltaTime / waitTime); and it will move it to that spot. Then you dont need any other of the code unless you want to see if it there…Object.transform == TargetVector.transform then its there and do what you need. Hope this helped.