Trouble Interpolating between two Vectors

I have a gameObject and got a point from a Raycast hit I am looking to move the GameObject for it’s current position to the point over time.

Can someone please point me in the right direction?

Thanks for the help!

– Clint

var object : GameObject;
var oldPosition : Vector3;
var hit : RaycastHit;
var moveSpeed = 1.00;

private var time = 0.00;

// do this once the raycast is done. remember to reset the time if this is to be done more than once.

oldPosition = object.transform.position;
time = 0;

function Update () {
	
	if(time != 1) {

		time += Time.deltaTime * moveSpeed;
		object.transform.position = Vector3.Lerp(oldPosition, hit.point, time);
		if(time >= 1) time = 1;
	}
}

Excellent, Lerp is what I was looking for!

Thanks for the help!

– Clint