code to Lerp player up

I have a climbing animation but the player is climbing out of his collider ( have Y translate in animation) so I think I need to remove the Y translate in the animation ( have him climbing in place) then Lerp him up over 3 seconds. As is after he is done climbing he just drops back down when he goes into his idle

C# code to Lerp Player +1 in the Y axis over 3 seconds

IEnumerator YLerp(){

		float t = 0;
		float currentYPos = transform.position.y;
		float targetYPos = currentYPos + 1f;

		while(currentYPos < targetYPos){

			t += Time.deltaTime;
			currentYPos = Mathf.Lerp(currentYPos, targetYPos, t/3);
			transform.position = new Vector3(transform.position.x, currentYPos, transform.position.z);
			yield return null;
		}

It’s not tested though.