I have 2 gameobjects: obj1
and obj2
I control obj2 along the x axis manually. I want obj2’s y position to slowly match obj1’s y position. I can’t use Vector3 Lerp, as I control obj2’s x movement. I only want to lerp the y axis.
How do I do this?
My attempt:
obj2.transform.position = new Vector3 (obj2.transform.position.x + myManualInput, obj1.transform.position.y, 0);
This however, instantly jumps to obj1’s y position. I want it to move smoothly.