Problem with linear interpolation along the y-axis using Mathf.Lerp

Hey all.

Im trying to interpolate an object up and down the y-axis, but how the object moves does not correlate with the output of the Mathf.Lerp function. For example if I do like this:

transform.position = new Vector3(transform.position.x, Mathf.Lerp(1f, 2f, t), transform.position.z) //where t varies in the range [0f,1f]

my game object moves between 0.125 and 0.25, but if I debug Mathf.Lerp(1f, 2f, t) it prints the correct values (the range [1f,2f]). Do any of you have an idea why this is?

/David

try:

function Start()
{
transform.position.y = 1f;
}
 
function Update()
{
transform.position.y = Mathf.Lerp(transform.position.y,2f,t);
}