I need help with a simple transform script...

Hello. I want to have an object move one unit of relative space in one second and then stop. So if a cube is 1.75 units tall and is positioned in world space at 0,0,0 over the course of one second it will move to 0,1.75,0 in world space and stop exactly there…no more no less. I say exact because I am running into problems with my script. For some reason, the object’s final position is always a bit off (just a few fractions of a unit over the specified distance…this may not seem like much but for how my game is set, it needs to be perfect). If it helps, the objects in my game will move the specified distance when the user presses a button (am I overcomplicating things…is there any way this can be handled in just the update/gui functions?).

What am I doing wrong? Thanks

var move = true;

function Start () {
	Invoke("TEST",1);
}

function TEST  () {
	move=false;
}

function Update() {
	if(move==true){transform.Translate(Vector3.up * Time.deltaTime);}
}

Use something like the Translation coroutine in MoveObject. Update isn’t appropriate since it runs every frame.