I'm trying to smoothly move a transform from one location to another when a button is pressed. this code is in update function. when pressed it snaps to the target location instead of traveling there slowly and smoothly, any help?
if (Input.GetButton ("StartOver"))
{
//go back to start;
transform.parent = null;
transform.position = Vector3.Lerp (transform.position, target.position, Time.deltaTime * 5.0);
}